halkyonio / container-images

Repo containing info needed to build different images: supervisord, spring boot s2i, spring boot maven s2i, ...
1 stars 2 forks source link

fix: give running application a chance to stop gracefully #5

Closed Ladicek closed 1 year ago

Ladicek commented 4 years ago

When hal asks the running application to stop, it does so by asking supervisord to ctl stop run. The supervisord configuration doesn't have a stopsignal configuration, so supervisord proceeds to directly sending SIGKILL. It's a good practice that applications react to SIGTERM and perform graceful shutdown. This commit therefore configures supervisord to first send SIGTERM and only if the application is still running after 5 seconds, proceed with SIGKILL.

Ladicek commented 4 years ago

I just realized I didn't really test this with an application that doesn't react to SIGTERM :-) Not sure if, in such situation, supervisord ctl stop run will wait until SIGKILL is delivered or not.