[New-bugs-announce] [issue32576] concurrent.futures.thread potential deadlock due to Queue in weakref callback
Gregory P. Smith
report at bugs.python.org
Tue Jan 16 20:04:08 EST 2018
New submission from Gregory P. Smith <greg at krypto.org>:
As a follow up to https://bugs.python.org/issue14976 which just introduced queue.SimpleQueue:
concurrent.futures.thread currently uses a queue.Queue() from weakref callbacks which could in theory lead to a deadlock when periodic gc triggers a cleanup invalidating some weakrefed objects at an inopportune time while Python code has the queue's lock held.
I don't have a test case proving this (deadlocks are hard).
Switching it to use a SimpleQueue should avoid the problem?
...
This and the C extension module based SimpleQueue would be good to backport to https://pypi.python.org/pypi/futures as well.
----------
messages: 310124
nosy: gregory.p.smith, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: concurrent.futures.thread potential deadlock due to Queue in weakref callback
type: behavior
versions: Python 3.7
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32576>
_______________________________________
More information about the New-bugs-announce
mailing list