-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
I am seeing a weird behavior where Gunicorn does not shutdown immediately when sent a SIGTERM. I see this with Python 3.5 on Ubuntu 16.04. The following environments (that I have access to) do not exhibit this issue:
- Python 2.7 on Ubuntu 16.04
- Python 2.7 on Ubuntu 14.04
- Python 3.4 on Ubuntu 14.04
Refer to https://gist.github.com/suriya/1d9a11ea9ad33a5b1df0b2ba7ed0cd0e on how to reproduce this issue.
After debugging a while, I found that the Gunicorn arbiter properly signals the child worker. The child workers handle the signal properly as well (on all versions). However, something prevents the loop in run_for_one
function
gunicorn/gunicorn/workers/sync.py
Line 58 in 9d158be
while self.alive: |
Could Python 3.5's change in the behavior of select.select()
https://docs.python.org/3/library/select.html#select.select explain this issue.