Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kill Assault On a method call #322

Open
vgaur opened this issue Jul 6, 2022 · 3 comments
Open

Kill Assault On a method call #322

vgaur opened this issue Jul 6, 2022 · 3 comments
Labels

Comments

@vgaur
Copy link

vgaur commented Jul 6, 2022

I am trying to add point cut on a method of service class and want the app to get killed when the method gets executed. Looked at the code of the interceptor and it seems it only works for RequestAssault and not on runtime assault.

I have provided detail on SO here
https://stackoverflow.com/questions/72824307/spring-boot-chaos-monkey-kill-assault

Expected Behavior

I was expecting to set the kill Assault point cut and when the code execution happen , the app should get killed.

Possible Solution

One possible way is to include Runtime Assault in interceptor.

@WtfJoke
Copy link
Contributor

WtfJoke commented Jul 8, 2022

Hi @vgaur

The KillAppAssault is a RuntimeAssault. They need to be executed on your own or on a specific timeframe by specifing a cron expression like described in the docs to RuntimeAssaults. Currently its not possible to execute RuntimeAssaults when doing requests.

So by either make a POST request to http://localhost:8080/actuator/chaosmonkey/assaults/runtime/attack (when enabled actuator) or specifing a cron expression in your application.properties works: chaos.monkey.assaults.kill-application-cron-expression=0 1/1 * * * * (this expression kills the app each minute).

Can you please verify it if it works in your case?

@vgaur
Copy link
Author

vgaur commented Jul 11, 2022

Thanks a lot @WtfJoke for your reply.
Yes, the behavior you have specified is working perfectly fine. I was confused because of this
https://codecentric.github.io/chaos-monkey-spring-boot/latest/#_appkiller_assault

Where it says
When the configured methods are called in the application, the Chaos Monkey will shut down the application.

To give you some background on what I was trying, I have some apache camel based demon processes and I wanted to test the app if the backend job fails at a particular method.

@WtfJoke WtfJoke added docs Documentation bug labels Jul 11, 2022
@WtfJoke
Copy link
Contributor

WtfJoke commented Sep 23, 2022

Sorry for my late reply. That's a documentation issue.

If I recall correctly the AppKiller Assault used to work once like that (before it was differentiated between Runtime/RequestAssaults).

About your use case. Wont the Exception-Assault work in your case as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants