Open magnusbaeck opened 5 years ago
Unfortunately the patch described above isn't enough. There's a lot of stuff going on in catalina.sh and the JVM ends up as pid 10 or so. If we drop the external Tomcat as suggested in https://github.com/eiffel-community/eiffel-remrem-generate/issues/142 I suspect this issue will solve itself.
Hi @magnusbaeck, can you provide a fix for this.
Yes, but I won't have time for it until next week.
Description
When a Docker container is stopped via
docker stop
ordocker restart
, SIGTERM is sent to pid 1. The container is given a limited time (default 10 s) to shut down before a SIGKILL is issued. REMReM Publish fails to respond to the SIGTERM signal since pid 1 is the bash process running start-service.sh so you have to wait around for the SIGKILL. We should make sure the Tomcat JVM becomes pid 1 to speed up shut downs and allow the process to clean up. It's probably enough to changein start-service.sh to:
Benefits
Quicker container shutdowns (and therefore restarts) reduce downtime and is less of a PITA when testing the container. Also, if we want to hook into the SIGTERM and perform some kind of cleanup we have to make this change since the eventual SIGKILL signal can't be trapped.
Possible Drawbacks
None.