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

Docker container doesn't respond correctly to SIGTERM #177

Open
magnusbaeck opened this issue Nov 2, 2019 · 3 comments
Open

Docker container doesn't respond correctly to SIGTERM #177

magnusbaeck opened this issue Nov 2, 2019 · 3 comments

Comments

@magnusbaeck
Copy link
Member

Description

When a Docker container is stopped via docker stop or docker 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 change

/eiffel/health-check.sh && catalina.sh run

in start-service.sh to:

/eiffel/health-check.sh && exec catalina.sh run

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.

@magnusbaeck
Copy link
Member Author

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 eiffel-community/eiffel-remrem-generate#142 I suspect this issue will solve itself.

@SantoshNC68
Copy link
Member

Hi @magnusbaeck, can you provide a fix for this.

@magnusbaeck
Copy link
Member Author

Yes, but I won't have time for it until next week.

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

No branches or pull requests

2 participants