[issue32576] concurrent.futures.thread potential deadlock due to Queue in weakref callback

2018-01-17 Thread Mark Dickinson

Mark Dickinson  added the comment:

See also https://bugs.python.org/issue21009

--
nosy: +mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32576] concurrent.futures.thread potential deadlock due to Queue in weakref callback

2018-01-17 Thread Antoine Pitrou

Change by Antoine Pitrou :


--
keywords: +patch
pull_requests: +5069
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32576] concurrent.futures.thread potential deadlock due to Queue in weakref callback

2018-01-17 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

We could also switch multiprocessing.Pool.  Unfortunately some code in 
multiprocessing.Pool relies on internal details of queue.Queue (!).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32576] concurrent.futures.thread potential deadlock due to Queue in weakref callback

2018-01-16 Thread Gregory P. Smith

New submission from Gregory P. Smith :

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com