[issue14976] queue.Queue() is not reentrant, so signals and GC can cause deadlocks

Itamar Turner-Trauring report at bugs.python.org
Mon Feb 17 19:50:43 CET 2014


Itamar Turner-Trauring added the comment:

This is not specifically a signal issue; it can happen with garbage collection as well if you have a Queue.put that runs in __del__ or a weakref callback function.

This can happen in real code. In my case, a thread that reads log messages from a Queue and writes them to disk. The thread putting log messages into the Queue can deadlock if GC happens to cause a log message to be written right after Queue.put() acquired the lock.
(see https://github.com/itamarst/crochet/issues/25).

----------
nosy: +itamarst
title: Queue.PriorityQueue() is not interrupt safe -> queue.Queue() is not reentrant, so signals and GC can cause deadlocks
versions: +Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14976>
_______________________________________


More information about the Python-bugs-list mailing list