Why are my gunicorn Python/Flask workers exiting from signal term?

I have a Python/Flask web application that I am deploying via Gunicorn in a docker image on Amazon ECS. Everything is going fine, and then suddenly, including the last successful request, I see this in the logs:

[2017-03-29 21:49:42 +0000] [14] [DEBUG] GET /heatmap_column/e4c53623-2758-4863-af06-91bd002e0107/ADA
[2017-03-29 21:49:43 +0000] [1] [INFO] Handling signal: term
[2017-03-29 21:49:43 +0000] [14] [INFO] Worker exiting (pid: 14)
[2017-03-29 21:49:43 +0000] [8] [INFO] Worker exiting (pid: 8)
[2017-03-29 21:49:43 +0000] [12] [INFO] Worker exiting (pid: 12)
[2017-03-29 21:49:43 +0000] [10] [INFO] Worker exiting (pid: 10)
...
[2017-03-29 21:49:43 +0000] [1] [INFO] Shutting down: Master

  • How to give non-root user in Docker container access to a volume mounted on the host
  • Has anyone been able to establish a WinRM remote powershell session to a Windows Docker container?
  • How to set Docker ENTRYPOINT To NPM?
  • Adding services in different consul clients running on same host
  • How to create a Docker image of centos provisioned with apache?
  • In Docker, why is it recommended to run `apt-get` update in the Dockerfile?
  • And the processes die off and the program exits. ECS then restarts the service, and the docker image is run again, but in the meanwhile the service is interrupted.

    What would be causing my program to get a TERM signal? I can’t find any references to this happening on the web. Note that this only happens in Docker on ECS, not locally.

  • Tomcat deployment using Docker and Kubernetes
  • Shared library in containers
  • install mongoose in docker container
  • How to check that the docker container is restarted and accessible?
  • Automation of docker pull via scala
  • Docker Registry 2.0 - how to delete unused images?
  • One Solution collect form web for “Why are my gunicorn Python/Flask workers exiting from signal term?”

    It turned out that after adding a login page to the system, the health check was getting a 302 redirect to /login at /, which was failing the health check. So the container was periodically killed. Amazon support is awesome!

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.