-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 receiving HUP signal and restarting #1824
Comments
Reloading is the expected response to HUP. The reload should be graceful. If it's not graceful, that is a bug with the threaded worker (related: #1236). If you don't want gunicorn to reload, do not send HUP. |
I am not sending HUP, OS sends it or somehow it automatically receives it. |
You will have to look into the process pool to figure out why Gunicorn receives HUP. Maybe your application receives HUP and the process pool sends it to all children, or maybe the process pool sends HUP for some other reason. Is it causing errors, though? Do clients get disconnected in the middle of requests, or is it at least a graceful reload? If it is not graceful, there may a be a bug. |
I am unable to identify the source of HUP signal. But somehow gunicorn receives it from somewhere and gets restarted. I am unable to find a way for graceful closure. It just kills anything that is running and simply restarts. |
When you say "kills anything that is running" do you mean requests / connections or some background thread you have started? Are they long requests (websocket, long poll)? It should close connections gracefully, but there is a timeout after which it kills them hard. |
what are these hidden line though? Seems like the master is receiving an HUP signal right after .... |
@benoitc what hidden lines are you talking about? |
@tilgovi It simply restarts everything, I do run some background processes well. They also get killed and server as a whole restarts. |
what is this ^^ ? |
@benoitc This is the progress of a job that I run in background in form of different processes. |
could that job be responsible of the HUP signal? What if you don't run it? |
The job is my product. |
well , something in your system is sending that HUP signal. You have to check if it’s not this job. maybe you can also check the debug log or spew lov to see at which point it os happening |
What is spew lov? |
@talhachattha pups, it's the |
closing issue, no more news since. |
I have been running a gunicorn server with 4 workers and 40 threads, I receive a request to start a job for which I use pebble and its ProcessPool for work to remain asynchronous.
After running for few hours gunicorn automatically receives HUP signal and restarts causing those processes to stop and thus job failure.
Following is the output of what I receive.
[2018-06-28 09:50:33 -0700] [8266] [INFO] Starting gunicorn 19.8.1
[2018-06-28 09:50:33 -0700] [8266] [INFO] Listening at: http://0.0.0.0:7788 (8266)
[2018-06-28 09:50:33 -0700] [8266] [INFO] Using worker: threads
[2018-06-28 09:50:33 -0700] [8269] [INFO] Booting worker with pid: 8269
[2018-06-28 09:50:33 -0700] [8270] [INFO] Booting worker with pid: 8270
[2018-06-28 09:50:33 -0700] [8271] [INFO] Booting worker with pid: 8271
100%|██████████| 70/70 [03:55<00:00, 3.36s/it]
Run Completed, Saving the result
39%|███▉ | 4042/10240 [15:27<20:52, 4.95it/s]
[2018-06-28 10:27:47 -0700] [8266] [INFO] Handling signal: hup
[2018-06-28 10:27:47 -0700] [8266] [INFO] Hang up: Master
[2018-06-28 10:27:47 -0700] [22456] [INFO] Booting worker with pid: 22456
[2018-06-28 10:27:47 -0700] [22457] [INFO] Booting worker with pid: 22457
[2018-06-28 10:27:47 -0700] [22458] [INFO] Booting worker with pid: 22458
The text was updated successfully, but these errors were encountered: