Skip to content

Conversation

TomBaxter
Copy link
Member

@TomBaxter TomBaxter commented Jun 14, 2017

Purpose:

SVCS-369
"docker-compose stop" sends SIGTERM.
This PR catches and handles the SIGTERM signal.

Changes:

Update mfr/server/app.py

  • Add catch for SIGTERM during server creation
  • Add def sig_handler to exit gracefully

Side effects

None

[#SVCS-369]

"docker-compose stop" sends SIGTERM. This PR catches and handles the SIGTERM signal. Adapted from... https://gist.github.com/wonderbeyond/d38cd85243befe863cdde54b84505784 Per docker documentation https://docs.docker.com/engine/reference/run/ Note: A process running as PID 1 inside a container is treated specially by Linux: it ignores any signal with the default action. So, the process will not terminate on SIGINT or SIGTERM unless it is coded to do so.
Copy link
Contributor

@cslzchen cslzchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Really love this feature (already on the WB), thanks. 🔥 🔥

@TomBaxter TomBaxter changed the title Catch SIGTERM and exit gracefully. [SVCS-369] Catch SIGTERM and exit gracefully. Oct 5, 2017
@felliott felliott closed this in 02c2db8 Oct 9, 2017
@TomBaxter TomBaxter deleted the feature/svcs-369 branch November 14, 2017 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants