Skip to content

Commit 2a76f56

Browse files
duanegvsajip
authored andcommitted
gh-91555: add warning to docs about possibility of deadlock/infinite recursion (GH-135954)
* gh-91555: add warning to docs about possibility of deadlock/infinite recursion Attempt to clarify in the documentation that care must be taken when using multiprocessing classes to implement logging since they have builtin internal logging, and hence may cause deadlock/infinite recursion. * Update Doc/library/logging.handlers.rst Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk> * Change whitespace. --------- (cherry picked from commit a4625d5) Co-authored-by: Duane Griffin <duaneg@dghda.com> Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
1 parent a724632 commit 2a76f56

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Doc/library/logging.handlers.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,15 @@ possible, while any potentially slow operations (such as sending an email via
10521052
.. note:: If you are using :mod:`multiprocessing`, you should avoid using
10531053
:class:`~queue.SimpleQueue` and instead use :class:`multiprocessing.Queue`.
10541054

1055+
.. warning::
1056+
1057+
The :mod:`multiprocessing` module uses an internal logger created and
1058+
accessed via :meth:`~multiprocessing.get_logger`.
1059+
:class:`multiprocessing.Queue` will log ``DEBUG`` level messages upon
1060+
items being queued. If those log messages are processed by a
1061+
:class:`QueueHandler` using the same :class:`multiprocessing.Queue` instance,
1062+
it will cause a deadlock or infinite recursion.
1063+
10551064
.. method:: emit(record)
10561065

10571066
Enqueues the result of preparing the LogRecord. Should an exception

0 commit comments

Comments
 (0)