logrotate (USR1 signal) restarts uvicorn worker #1558
-
I use FastAPI+Uvicorn+Gunicorn and issuing USR1 signal to uvicorn worker restarts the worker. I believe the issue is to do with uvicorn worker not implementing signal handler - github.com/encode/uvicorn/blob/….
It converts it to signal.SIG_DFL. SIGUSR1 and SIGUSR2 both have the default action Term -- the process is terminated. (unix.stackexchange.com/questions/38589/…) According to a similar issue page, #896 (comment) I also notice that Uvicorn only handles two signals:
I would be more than happy to contribute to uvicorn, if I could change the worker init_signals function to do the same with gunicorn worker?
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
seems legit issue to me, coming from https://stackoverflow.com/questions/72891901/gunicorn-worker-terminated-due-to-signal-10 |
Beta Was this translation helpful? Give feedback.
-
Added steps to reproduce and a potential solution here: |
Beta Was this translation helpful? Give feedback.
seems legit issue to me, coming from https://stackoverflow.com/questions/72891901/gunicorn-worker-terminated-due-to-signal-10
I guess the #895 was a little bit too much on resetting signal for that usecase
PR welcomed