Chaosblade executor for chaos experiments on Java applications

Overview

logo

Chaosblade-exec-jvm: Chaosblade executor for chaos experiments on Java applications

Introduction

The project is a chaosblade executor based on jvm-sandbox for chaos experiments on Java applications by enhancing classes. The drill can be implemented through the blade cli, see chaosblade project for details.

Compiling

In the project root directory, execute the following command to compile

make

The compilation result will be stored in the target directory.

Contributing

We welcome every contribution, even if it is just a punctuation. See details of CONTRIBUTING

Bugs and Feedback

For bug report, questions and discussions please submit GitHub Issues.

Contact us: [email protected]

Gitter room: chaosblade community

License

Chaosblade-exec-jvm is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

Comments
  • mysql 故障注入 match 条件不生效

    mysql 故障注入 match 条件不生效

    1、match 为 port=xxxx,没法注入故障 2、match 为 sqlType=insert,包括 select 等在内的所有 mysql 操作都被注入了故障

    附录:使用的版本 spec: matchers: - desc: The sql type, for example, select, update and so on. name: sqltype noArgs: false required: false - desc: The database name which used name: database noArgs: false required: false - desc: The database port which used name: port noArgs: false required: false - desc: The database host name: host noArgs: false required: false - desc: The first table name in sql. name: table noArgs: false required: false

    type/question 
    opened by canyuns 6
  • feature: add business data match

    feature: add business data match

    Signed-off-by: wufan [email protected]

    Describe what this PR does / why we need it

        Provides the ability to match specific business data for injection by getting business data from rpc or implementing the specific spi interface.
    

    Does this pull request fix one issue?

       Fixes #203
    

    Describe how you did it

    blade create dubbo throwCustomException --consumer --service=com.qunar.api --version=1.0.0  --b-parms='[{
    "key":"a",
    "value":"a_value",
    “mode”:"spi"
    },
    {
    "key":"b",
    "value":"b_value",
    “mode”:"spi"
    }]’
    
    type/feature 
    opened by wufunc 5
  • ./blade prepare jvm XXXX failed

    ./blade prepare jvm XXXX failed

    ~/chaosblade-0.0.3 # ./blade prepare jvm --process XXX {"code":604,"success":false,"error":"com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded\n\tat sun.tools.attach.LinuxVirtualMachine.\u003cinit\u003e(LinuxVirtualMachine.java:106)\n\tat sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:63)\n\tat com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:208)\n\tat com.alibaba.jvm.sandbox.core.CoreLauncher.attachAgent(CoreLauncher.java:59)\n\tat com.alibaba.jvm.sandbox.core.CoreLauncher.\u003cinit\u003e(CoreLauncher.java:20)\n\tat com.alibaba.jvm.sandbox.core.CoreLauncher.main(CoreLauncher.java:43)\nsandbox load jvm failed : Unable to open socket file: target process not responding or HotSpot VM not loaded\n exit status 255","result":"069b4c4004e1c3ff"}

    NAME="SLES" VERSION="12-SP2" VERSION_ID="12.2" PRETTY_NAME="SUSE Linux Enterprise Server 12 SP2" ID="sles" ANSI_COLOR="0;32"

    type/question 
    opened by johngerwong 5
  • fix unable to find non-public method of super class

    fix unable to find non-public method of super class

    Describe what this PR does / why we need it

    Does this pull request fix one issue?

    #96 fix unable to find non-public method of super class

    Describe how you did it

    Describe how to verify it

    Special notes for reviews

    opened by zuoc 4
  • Fixes #49: Dubbo interceptor should support group

    Fixes #49: Dubbo interceptor should support group

    Describe what this PR does / why we need it

    Does this pull request fix one issue?

    Fixes #49: Dubbo interceptor should support group

    Describe how you did it

    split dubbo service into group,service and version

    type/feature 
    opened by dreamquster 4
  • Add support delay for Log framework

    Add support delay for Log framework

    Issue Description

    Type: feature request

    Describe what happened (or what feature you want)

    Add support delay for Log framework, such as logback.

    Describe what you expected to happen

    blade create log delay --time 500 --effect-count 100

    type/feature 
    opened by zhucegep 3
  • fix: throw self-defined exception occur error #8

    fix: throw self-defined exception occur error #8

    Describe what this PR does / why we need it

    Fix bug

    Does this pull request fix one issue?

    Yes

    Fixes #8

    Describe how you did it

    Describe how to verify it

    Special notes for reviews

    type/bug 
    opened by Vascal 3
  • Occurring error when I execute a tce or tde experiment with self-defined exception

    Occurring error when I execute a tce or tde experiment with self-defined exception

    Issue Description

    Type: bug report

    There is an issue when I throw an self-defined Exception which don't have a with-param constructor.

    For example,

    1.Self-defined Exception which don't hava a with-param constructor image And it will get error when I execute ted or tcd experiment image

    2.But doing this with an Exception which have a with-param constructor get another result image image

    type/bug 
    opened by Vascal 3
  • Kafka delay拦截点位效果不大

    Kafka delay拦截点位效果不大

    Issue Description

    Type: bug report or feature request

    Describe what happened (or what feature you want)

    Describe what you expected to happen

    Chaosblade-exec-plugin-kafka 拦截点分析

    Kafka支持2种基础故障场景注入:Delay 和 throw custom exception

    这2种演练场景是JVM框架层通用的故障场景。

    针对没有外部网络交互的方法层面的delay,delay的处理逻辑很简单,只需要在指定的方法层面进行注入即可,即在执行到对应方法时进行延时注入; 但是在对有外部网络交互的方法层面的delay模拟时,delay此时的语义应该尽可能模拟网络的超时,实现类似真实网络超时的效果;

    因而对于有外部网络交互的Delay应该有这样的语义:

    1. 不网卡即可以达到模拟发送超时的目的;
    2. 比网卡超时注入有更精确的控制粒度,如超时几次;
    3. 尽可能模拟外部超时的现象,最好能够触发和网络超时一样的异常;

    基于上述对Delay故障定义的描述 让我们看看如何对Kafka组件进行延时发送故障模拟

    Kafka发送的流程是异步解耦的,大致可以分为2部分 消息组装后暂存到Deque; Sender线程从Deque中取出消息添加到InFlightRequests队列中,最后投递出去;

    因此我们需要做的是在消息暂存到Deque后进行超时故障的注入,即发送的第二个环节;

    再来看Kafka对消息超时的判定:

    1. Deque中超时的消息;
    2. Inflight中超时的消息;

    由此得出以下3种方式:

    1. 直接在Deque后注入超时(Sender.run);
    2. 在添加到InflightRequest请求中时进行延时注入;
    3. 在将InflightRequest中的请求进行投递时进行超时注入; 分别对3种方式进行探究: 第一种场景,范围较大,相当于sender线程每次需要投递时就休眠对应时间,造成的后果是会影响其他待发送的消息,这样的话影响的消息条数不可控; 第二种场景,在doSend方法中添加到Inflight前进行延时故障注入 因为doSend方法依然是异步的,这是标记write状态,因此如果在这里执行超时,也会影响后续待发送消息; 第三种场景,在执行网络投递时进行延时注入; Kafka真正网络投递的方法是NetworkClient.poll(注意,consumer的ack也是在这里),如果在这里,会影响消息的ack;

    因此综合考虑,基于kafka的批量特性,kafka的发送延时无法实现任何场景下的精确数量命中,不过也能符合大多数场景需求了,暂时就这样吧。 后面我会提个pr,大佬review一下

    How to reproduce it (as minimally and precisely as possible)

    Tell us your environment

    Anything else we need to know?

    opened by zhuangzhuangdashen 2
  • add business param pattern match

    add business param pattern match

    Describe what this PR does / why we need it

    add business param pattern match

    Does this pull request fix one issue?

    fixes:https://github.com/chaosblade-io/chaosblade-exec-jvm/issues/227

    Describe how you did it

    Describe how to verify it

    Special notes for reviews

    type/feature 
    opened by binbin0325 2
  • support jvm return any type

    support jvm return any type

    Describe what this PR does / why we need it

    support jvm return any type

    Does this pull request fix one issue?

    Fixes:https://github.com/chaosblade-io/chaosblade-exec-jvm/issues/223

    Describe how you did it

    Describe how to verify it

    Special notes for reviews

    type/feature 
    opened by binbin0325 2
  • servlet modifyCode not support b-params

    servlet modifyCode not support b-params

    Issue Description

    Type: bug report

    Describe what happened (or what feature you want)

    servlet modifyCode not support b-params

    Describe what you expected to happen

    servlet modifyCode support b-params

    How to reproduce it (as minimally and precisely as possible)

    Tell us your environment

    Anything else we need to know?

    opened by binbin0325 0
  • chore(deps): bump snakeyaml from 1.26 to 1.32 in /chaosblade-exec-service

    chore(deps): bump snakeyaml from 1.26 to 1.32 in /chaosblade-exec-service

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • oom fill with precision

    oom fill with precision

    Describe what this PR does / why we need it

    Does this pull request fix one issue?

    fixes:https://github.com/chaosblade-io/chaosblade-exec-jvm/issues/291

    Describe how you did it

    Describe how to verify it

    Special notes for reviews

    opened by binbin0325 0
  • oom accurately fill memory

    oom accurately fill memory

    Issue Description

    Type: bug report

    Describe what happened (or what feature you want)

    在注入oom故障时,每次填充的内存大小并不是严格按照 block参数进行填充。 因为在创建oomObject对象时,使用的是byte[1024*300], 经过new String()后让内存分配翻倍。

    How to reproduce it (as minimally and precisely as possible)

    Tell us your environment

    Anything else we need to know?

    opened by binbin0325 0
  • fix getActionFlag parseBoolean

    fix getActionFlag parseBoolean

    Describe what this PR does / why we need it

    Does this pull request fix one issue?

    fixes:https://github.com/chaosblade-io/chaosblade-exec-jvm/issues/289

    Describe how you did it

    Describe how to verify it

    Special notes for reviews

    opened by binbin0325 0
  • ConfigUtil getActionFlag always false

    ConfigUtil getActionFlag always false

    Issue Description

    Type: bug report

    Describe what happened (or what feature you want)

        public static Boolean getActionFlag(EnhancerModel enhancerModel, String flagKey, Boolean defaultValue) {
            String value = getActionFlag(enhancerModel, flagKey);
            if (value == null) { return defaultValue; }
            try {
                return Boolean.parseBoolean(flagKey);
            } catch (Exception ex) {
                return defaultValue;
            }
        }
    

    should is return Boolean.parseBoolean(value);

    This causes the oom exception wild mode to be invalid

    Describe what you expected to happen

    How to reproduce it (as minimally and precisely as possible)

    Tell us your environment

    Anything else we need to know?

    opened by binbin0325 0
Releases(v1.7.1)
  • v1.7.1(Dec 14, 2022)

    What's Changed

    • optimize: support mongo count method by @arthur657834 in https://github.com/chaosblade-io/chaosblade-exec-jvm/pull/271
    • spring security plugin by @njzfit in https://github.com/chaosblade-io/chaosblade-exec-jvm/pull/278
    • extension of log plugin enable it to support log4j2 by @xuji007 in https://github.com/chaosblade-io/chaosblade-exec-jvm/pull/277
    • Extend plugin-mysql to support shardingJdbc by @JerryYe2020 in https://github.com/chaosblade-io/chaosblade-exec-jvm/pull/287
    • fix http b-params by @binbin0325 in https://github.com/chaosblade-io/chaosblade-exec-jvm/pull/286
    • optimize: modify the wrong class comment by @arthur657834 in https://github.com/chaosblade-io/chaosblade-exec-jvm/pull/288
    • update version to 1.7.1 by @MandssS in https://github.com/chaosblade-io/chaosblade-exec-jvm/pull/293

    New Contributors

    • @njzfit made their first contribution in https://github.com/chaosblade-io/chaosblade-exec-jvm/pull/278
    • @xuji007 made their first contribution in https://github.com/chaosblade-io/chaosblade-exec-jvm/pull/277
    • @JerryYe2020 made their first contribution in https://github.com/chaosblade-io/chaosblade-exec-jvm/pull/287

    Full Changelog: https://github.com/chaosblade-io/chaosblade-exec-jvm/compare/v1.7.0...v1.7.1

    Source code(tar.gz)
    Source code(zip)
  • v1.3.0(Aug 5, 2021)

  • v1.0.0(Mar 19, 2021)

  • v0.10.0(Mar 8, 2021)

    Features/Enhancements

    • Support hbase plugin. (#154 )
    • Support elasticsearch plugin. (#155 )
    • Support thread increased action. (#156 )
    • Support redisson. (#159 )
    • Support Lettuce client & MySQL Driver 8.x. (#160 )
    • Support kafka plugin. (#164 )

    Bug Fixes

    • fix compile. (#157)

    Others

    • add scenario category in action model

    Thanks for the contributors: @arthur657834 @tangyuhan0816 @lwsbox

    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Nov 3, 2020)

    Features/Enhancements

    • Script support load external jar. (#138 )
    • Add mongoDB plugin. (#147 )

    Bug Fixes

    • Could not find artifact com.sun:tools:jar:1.8. (#139 )
    • Compile script exception. (#146 )

    Others

    • bump junit from 4.12 to 4.13.1. (#140 #141 #142 #143 #144 #145 )

    Thanks for the contributors: @tiny-x @arthur657834

    Source code(tar.gz)
    Source code(zip)
  • v0.7.0(Sep 28, 2020)

    Features/Enhancements

    • Support dubbo generic invoke.
    • Support Okhttp3 plugin. (#131 )
    • Add rabbitmq plugin. (#132 )
    • Replace fastjson to jackon. (#133 )
    • Improvement the action use case. (#134 )
    • Add programs field in model specfication. (#136 )

    Bug Fixes

    • Fix the BeforeEnhancer is still executed when destroying.
    • Fix psql plugin does not get the database field.
    • Fix jvm return aciton, if expression parameter is double type add overflow.

    Others

    • Improvement on the CONTRIBUTING.md file. (#126 )
    • Add doc design.md plugin.md quick-start.md and improvement servlet plugin. (#127 )

    Thanks for the contributors: @anje123 @tiny-x @pengpj @raygenyang @xcaspar

    Source code(tar.gz)
    Source code(zip)
    chaosblade-java-agent-0.7.0.jar(8.99 MB)
    chaosblade-jvm-spec-0.7.0.yaml(45.31 KB)
  • v0.4.0(Dec 5, 2019)

    Features/Enhancements

    • Support method after event processing for java experiments (#91)
    • Support targe object in params for java experiments (#94)
    • Support for dubbo 2.7 version for java experiments (#100)

    Bug Fixes

    • Fix unable to find non-public method of super class for java experiments (#96)
    • Fix experiments stopped when uninstall java agent directly (#99)

    Thank you for the flowing contributors: @zuoc

    Source code(tar.gz)
    Source code(zip)
    chaosblade-java-agent-0.4.0.jar(7.78 MB)
    chaosblade-jvm-spec-0.4.0.yaml(31.42 KB)
  • v0.1.0(Jun 21, 2019)

    This version provides a lot of java chaos experiment's features, such as cpu full load in jvm, dynamic script parsing(support java and groovy script), httpclient plugin, limits of request count and request percent about chaos effected and so on.

    Features/Enhancements

    • Add support for cpu full load in jvm process(#40 )
    • Add support for limits of request count and request percent about chaos effected(#46 )
    • Add support for dynamic script parsing(#38 )
    • Add support for the Apache HttpClient component(#5 )

    Bug Fixes

    • Fix "jvm return value" command do not support space or other invalid url char in value string(chaosblade #97)
    • Fix the class name method name is required for java chaos experiments(chaosblade #80)
    • Fix java.lang.NoSuchMethodException: null(chaosblade #83)
    • Fix unsupported major.minor version 52.0\n exit status 255 on (chaosblade #77)

    Thanks for the contributors: @dreamquster @guohz-git @sjha2048 @wangkechun @tangyuhan0816

    Source code(tar.gz)
    Source code(zip)
    chaosblade-java-agent-0.1.0.jar(7.73 MB)
    jvm.spec.yaml(17.72 KB)
  • v0.0.3(May 5, 2019)

    Features/Enhancements

    • Add jvm oom experiment contains heap, noheap and direct buffer area. (#18 )
    • Add dubbo thread pool full experiment. (#22 )
    • Add druid connection pool full experiment. (#24 )

    Bug Fixes

    • Fix unbind moduleEventWatcher when deleting jvm plugin. (#9 )
    • Fix code error about determining actionSpec value. (#12 )
    • Fix throwing self-defined exception occur error. (#19 )

    Thanks for the contributors: @RinaisSuper @yangsr

    Source code(tar.gz)
    Source code(zip)
    chaosblade-java-agent-0.0.3.jar(3.78 MB)
    jvm.spec.yaml(11.07 KB)
Owner
null
Orkestra Workflow Executor Template Repo

Orkestra Workflow Executor Template Repo This is a template repository for a new workflow executor Usage Generate your repository from this template b

Nitish Malhotra 0 Nov 9, 2021
K3ai Executor is the runner pod to execute the "one-click" pipelines

Welcome to K3ai Project K3ai is a lightweight tool to get an AI Infrastructure Stack up in minutes not days. NOTE on the K3ai origins Original K3ai Pr

k3ai 0 Nov 11, 2021
Executor - Fast exec task with go and less mem ops

executor fast exec task with go and less mem ops Why we need executor? Go with g

Te Nguyen 5 Dec 19, 2022
Executor - Wrapper for exec.Command for simple using and multi commands executing

executor Examples package main import ( "fmt" "github.com/solar-jsoc/execut

null 5 Feb 12, 2022
XSD (XML Schema Definition) parser and Go/C/Java/Rust/TypeScript code generator

xgen Introduction xgen is a library written in pure Go providing a set of functions that allow you to parse XSD (XML schema definition) files. This li

null 211 Jan 1, 2023
jacobin - A more than minimal JVM written in Go and capable of running Java 11 bytecode.

This overview gives the background on this project, including its aspirations and the features that it supports. The remaining pages discuss the basics of JVM operation and, where applicable, how Jacobin implements the various steps, noting any items that would be of particular interest to JVM cognoscenti.

Andrew Binstock 59 Dec 29, 2022
An easy way to add useful startup banners into your Go applications

Try browsing the code on Sourcegraph! Banner Add beautiful banners into your Go applications Table of Contents Motivation Usage API Command line flags

Claudemiro 415 Jan 1, 2023
An easy to use, extensible health check library for Go applications.

Try browsing the code on Sourcegraph! Go Health Check An easy to use, extensible health check library for Go applications. Table of Contents Example M

Claudemiro 443 Dec 30, 2022
A simple wrapper to daemonize Go applications.

daemonigo A simple library to daemonize Go programming language applications. Installing $ go get github.com/tyranron/daemonigo After this command da

Kai Ren 38 Jul 15, 2022
Prometheus instrumentation library for Go applications

Prometheus Go client library This is the Go client library for Prometheus. It has two separate parts, one for instrumenting application code, and one

Prometheus 4.3k Jan 3, 2023
A simple Cron library for go that can execute closures or functions at varying intervals, from once a second to once a year on a specific date and time. Primarily for web applications and long running daemons.

Cron.go This is a simple library to handle scheduled tasks. Tasks can be run in a minimum delay of once a second--for which Cron isn't actually design

Robert K 215 Dec 17, 2022
Enable your Golang applications to self update with S3

s3update Enable your Golang applications to self update with S3. Requires Go 1.8+ This package enables our internal tools to be updated when new commi

Heetch 103 Jul 20, 2022
A BPMN engine, meant to be embedded in Go applications with minim hurdles, and a pleasant developer experience using it.

A BPMN engine, meant to be embedded in Go applications with minim hurdles, and a pleasant developer experience using it. This approach can increase transparency for non-developers.

Martin W. Kirst 94 Dec 29, 2022
A simple package to daemonize Go applications.

A simple package to daemonize Go applications.

Henrique Dias 0 Nov 13, 2021
Testkube-executor-k6 - TestKube K6 Load Test Executor

Welcome to TestKube Template Executor TestKube Template Executor is a test execu

M.-Leander Reimer 1 Mar 2, 2022
K8s_dns_chaos: enables inject DNS chaos in a Kubernetes cluster for Chaos Engineering

k8s_dns_chaos Name k8s_dns_chaos - enables inject DNS chaos in a Kubernetes cluster for Chaos Engineering. Description This plugin implements the Kube

邢凯 0 Dec 12, 2021
Aes for go and java; build go fo wasm and use wasm parse java response.

aes_go_wasm_java aes for go and java; build go fo wasm and use wasm parse java response. vscode setting config settings.json { "go.toolsEnvVars":

忆年 0 Dec 14, 2021
Update-java-ca-certificates - Small utility to convert the system trust store to a system Java KeyStore

update-java-ca-certificates This small utility takes care of creating a system-w

Swisscom 7 Dec 28, 2022
Experiments with Go generics

generics Quick experiments with Go generics algebra, a generic square root function for float, complex and and rational. future, a concurrent cache ("

Alan Donovan 84 Dec 31, 2022
Experiments with pulsar go client and protobuf

How to use proto schema with pulsar go client library Define a .proto file Generate Code using below command: protoc -I=. -I=$GOPATH/src -I=$GOPATH/sr

Deepak Sah 1 Nov 15, 2021