Open vanschelven opened 3 months ago
Related: https://github.com/benoitc/gunicorn/issues/2816
We do have suggested changes, notably https://github.com/benoitc/gunicorn/pull/3148 attempting to address this.
I've run into various issues issues with signals/logging/uvicorn. This issue contains the root cause for the problems we saw.
A summary that explains/connects various reported issues and might help others running into this:
The issue can be mitigated by decoupling logging using QueueHandler and QueueListener, provided by a custom logconfig(_dict/_json)
In the arbiter's signal-handling code, there are many uses of logging. E.g.
https://github.com/benoitc/gunicorn/blob/master/gunicorn/arbiter.py#L252
however, the docs say this:
https://docs.python.org/3/library/logging.html#thread-safety
elsewhere Gregory Smith says the following:
What the consequences of the above remarks are... may depend on how many signals you send.