[New-bugs-announce] [issue46121] Add a note to QueueListener documentation saying that SimpleQueue instances can't be used in multiprocessing scenarios

dmitry-bychkov report at bugs.python.org
Sat Dec 18 04:07:00 EST 2021


New submission from dmitry-bychkov <iamdbychkov at gmail.com>:

Currently, documentation for QueueListener (https://docs.python.org/3/library/logging.handlers.html#queuelistener) says:
"""
supports receiving logging messages from a queue, such as those implemented in the queue or multiprocessing modules.
"""

While also saying that we can use queue.SimpleQueue as an underlying queue:

"""
The queue is not required to have the task tracking API, which means that you can use queue.SimpleQueue instances for queue.
"""

I think it should also say that neither queue.SimpleQueue nor multiprocessing.SimpleQueue instances will work if your intended use of QueueListener is to receive logging messages from processes spawned by multiprocessing module. One should use multiprocessing.Queue instance.

usage of queue.SimpleQueue will result in pickle exception.
multiprocessing.SimpleQueue lacks the API QueueListener expects from queue.

English is not my first language so I'll step aside from PR's in documentation :)

----------
assignee: docs at python
components: Documentation
messages: 408838
nosy: docs at python, iamdbychkov
priority: normal
severity: normal
status: open
title: Add a note to QueueListener documentation saying that SimpleQueue instances can't be used in multiprocessing scenarios
type: enhancement
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46121>
_______________________________________


More information about the New-bugs-announce mailing list