Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I can issue a command via supervisorctl to shutdown my gunicorn_django process but sometimes it hangs around until I have to eventually kill it with a -9. The log for the process usually has this:

2011-12-07 23:42:36 [27031] [INFO] Booting worker with pid: 27031
2011-12-07 23:42:37 [27033] [INFO] Booting worker with pid: 27033
2011-12-08 17:44:19 [26931] [INFO] Handling signal: term
2011-12-08 17:44:20 [26966] [INFO] Worker exiting (pid: 26966)
2011-12-08 17:44:20 [26993] [INFO] Worker exiting (pid: 26993)
2011-12-08 17:44:20 [26934] [INFO] Worker exiting (pid: 26934)
2011-12-08 17:44:20 [26937] [INFO] Worker exiting (pid: 26937)
2011-12-08 17:44:20 [26939] [INFO] Worker exiting (pid: 26939)
2011-12-08 17:44:20 [26936] [INFO] Worker exiting (pid: 26936)
2011-12-08 17:44:20 [26935] [INFO] Worker exiting (pid: 26935)
2011-12-08 17:44:20 [26998] [INFO] Worker exiting (pid: 26998)
Exception KeyError: KeyError(47572017784944,) in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception KeyError: KeyError(47572017784944,) in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception SystemExit: 0 in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception KeyError: KeyError(47572017784944,) in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception SystemExit: 0 in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception SystemExit: 0 in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception KeyError:  in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception SystemExit:  in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception Exception SystemExit: 0 in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
SystemExit: 0 in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception SystemExit: 0 in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception SystemExit: 0 in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception SystemExit: 0 in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception SystemExit: 0 in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception SystemExit: 0 in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception SystemExit: 0 in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
2011-12-08 17:44:31 [23023] [INFO] Starting gunicorn 0.13.4
2011-12-08 17:44:31 [23023] [ERROR] Connection in use: ('127.0.0.1', 8001)
2011-12-08 17:44:31 [23023] [ERROR] Retrying in 1 second.
2011-12-08 17:44:32 [23023] [ERROR] Connection in use: ('127.0.0.1', 8001)
2011-12-08 17:44:32 [23023] [ERROR] Retrying in 1 second.
2011-12-08 17:44:33 [23023] [ERROR] Connection in use: ('127.0.0.1', 8001)
2011-12-08 17:44:33 [23023] [ERROR] Retrying in 1 second.
2011-12-08 17:44:34 [23023] [ERROR] Connection in use: ('127.0.0.1', 8001)
2011-12-08 17:44:34 [23023] [ERROR] Retrying in 1 second.
2011-12-08 17:44:35 [23023] [ERROR] Connection in use: ('127.0.0.1', 8001)
2011-12-08 17:44:35 [23023] [ERROR] Retrying in 1 second.
2011-12-08 17:44:36 [23023] [ERROR] Can't connect to ('127.0.0.1', 8001)

Here is some relevant supervisor config:

[program:gunicorn]
command=gunicorn_django --workers=20 --log-level info --timeout 500 --bind=127.0.0.1:8001
directory=/website/gunicorn-app
stdout_logfile=/var/log/gunicorn_log
stderr_logfile=/var/log/gunicorn_log
startsecs=10
autostart=true

I'm also not using root and the application is running within virtualenv

Can someone tell me if this is a python issue or a gunicorn issue?

share|improve this question
add comment

1 Answer

There used to be problems with gunicorn and supervisord, what version of gunicorn are you running. Did you try to upgrade?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.