This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: multiprocessing logger deadlocks if used with logging.handlers.QueueHandler
Type: Stage:
Components: Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: iamdbychkov
Priority: normal Keywords:

Created on 2021-12-23 13:12 by iamdbychkov, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
logger_deadlock.py iamdbychkov, 2021-12-23 13:12
Messages (1)
msg409088 - (view) Author: dmitry-bychkov (iamdbychkov) Date: 2021-12-23 13:12
Hello!
If you use multiprocessing logger with logging.handlers.QueueHandler it will deadlock on first attempt at logging.

First attempt will initialize queue's background thread, which uses multiprocessing logger itself which will result in something what looks like deadlock :) 

There are workarounds and I'm not sure if it can be classified as a bug, prehaps a little note in documentation about this behaviour will do? 

I've attached example script.
History
Date User Action Args
2022-04-11 14:59:53adminsetgithub: 90321
2021-12-23 13:12:46iamdbychkovcreate