-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Gunicorn process fails to stop by Supervisor's stop command and keeps locking ports #520
Comments
Any progress on this? |
Same issue. Bump! |
supervisor config:
start.sh: #!/bin/bash
/usr/local/bin/compass compile --boring --trace
source venv/bin/activate
pip install -r requirements.txt
if [ -e "env.sh" ]
then
source env.sh
fi
gunicorn app:app -c gunicorn.conf.py I've gathered that the problem is that some of the worker processes are still using port 7200 but aren't killed by supervisor when the process restarts? I really have no idea. I'm sort of a noob but I'm trying to learn quickly. Thanks so much for your speedy response, Benoit. |
@a2 cam you replace the line |
@benoitc If I change that line it makes no difference. If I |
It sounds like you have long lived connections and the high timeout combined with graceful restart is causes workers to exit slowly. Try TERM or INT instead of QUIT. |
@tilgovi Same result. |
what do you mean by restarting supervisor? Sending an HUP? in that case I Also if you can i would use dystemd that can pass a socket to gunicorn in
On Saturday, May 11, 2013, Alexsander Akers wrote:
|
signals have been switched in 8124190 . closing this issue, thanks for the feedback! |
@a2 it's because your bash script (via bash shell process) gets supervised, not gunicorn. Try using |
I know this is an old thread, but for anyone else who has landed here and is using make + gunicorn + supervisor, the above comment is the solution. Supervisor needs the specific gunicorn command to be able to kill the process- providing a make command that runs gunicorn will not kill the process. Something to do with make having its own shell, maybe. |
@fillest Thanks for the exec trick. |
I haven't looked at this in a while. If the documentation or examples for supervisord need any changes, please make a PR. Thanks! |
using exec is the key |
@abhijeetsangwan if something needs to change in examples/supervisor.conf please make a pull request. |
If you are using the latest version, this should be effective for your situation. |
I am having issue very similar to #291. Application processes (gunicorn based) are managed by supervisor and after fresh deploy is done, supervisored processes are ordered to restart.
In most cases, this works as expected but for one specific application this always fails and prevents application to restart properly. The old gunicorn processes hang up blocking ports for new ones. After few minutes, they finally die but still, this is very inconvenient since it causes unavailability in the app for too long time.
Supervisor config for the app is following:
Gunicorn's log doesn't show anything interesting but this:
The ERRORs are repeated for quite a while as mentioned above...
Env:
Python 2.6.6
Debian squeeze
Gunicorn 0.15.0
I might try to fix it by using fresh version of gunicorn, do you that it might be the solution? Don't wanna risk upgrading if it won't help anyway.
The text was updated successfully, but these errors were encountered: