You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Endpoint /chaosmonkey/assaults/runtime/attack should respond with 200 OK when killApplicationActive is set to true.
Current Behavior
There is no reply from the server, i.e. curl: (52) Empty reply from server when using cURL.
How to reproduce
Call below endpoints in order:
curl localhost:8080/actuator/chaosmonkey/assaults -X POST -d "{ \"killApplicationActive\": true }" -H "Content-Type: application/json"
curl localhost:8080/actuator/chaosmonkey/assaults/runtime/attack -X POST
Project details
Parent: spring-boot-starter-parent 3.2.4
spring-boot-starter-web (managed version)
spring-boot-starter-actuator (managed version)
chaos-monkey-spring-boot 3.1.0
Root cause
In the KillAppAssault#attack method, it calls SpringApplication.exit(context, () -> 0) to shut down Spring Boot.
This line will block until Spring Boot completes shutdown.
Spring Boot will stop all active requests as part of the shutdown routine.
Since the shutdown is being commenced within a request, Spring Boot can't proceed.
In the case of a graceful shutdown, Spring Boot keeps waiting, and when the grace period ends, it terminates all requests if they are still around.
In the case of an immediate shutdown (default), Spring Boot immediately terminates all requests.
That's why the /chaosmonkey/assaults/runtime/attack request never responds when it needs to kill the app.
Additional reference
In addition, if we check how Spring Boot's own /actuator/shutdown is implemented, we can see that it uses a new thread to perform the shutdown (ConfigurableApplicationContext#close).
The text was updated successfully, but these errors were encountered:
blackr1234
changed the title
/chaosmonkey/assaults/runtime/attack does not respond with 200 OK when killApplicationActive is true
[BUG] /chaosmonkey/assaults/runtime/attack does not respond when killApplicationActive is true
Apr 16, 2024
Expected Behavior
Endpoint
/chaosmonkey/assaults/runtime/attack
should respond with200 OK
whenkillApplicationActive
is set totrue
.Current Behavior
There is no reply from the server, i.e.
curl: (52) Empty reply from server
when using cURL.How to reproduce
Call below endpoints in order:
Project details
spring-boot-starter-parent 3.2.4
spring-boot-starter-web
(managed version)spring-boot-starter-actuator
(managed version)chaos-monkey-spring-boot 3.1.0
Root cause
KillAppAssault#attack
method, it callsSpringApplication.exit(context, () -> 0)
to shut down Spring Boot./chaosmonkey/assaults/runtime/attack
request never responds when it needs to kill the app.Additional reference
In addition, if we check how Spring Boot's own
/actuator/shutdown
is implemented, we can see that it uses a new thread to perform the shutdown (ConfigurableApplicationContext#close
).See: ShutdownEndpoint.java - line 49
The text was updated successfully, but these errors were encountered: