This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author glangford
Recipients glangford
Date 2014-01-21.00:18:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1390263519.32.0.357208079457.issue20319@psf.upfronthosting.co.za>
In-reply-to
Content
concurrent.futures.wait() can get into a state where it blocks forever on waiter.event.wait(), even when the underlying Futures have completed.

This is demonstrated in a stress test where a large number of wait() calls are run in multiple threads, contending for the same Futures.

The cause is believed to be waiter removal, which is done without locking the Future. 

A suggested fix which appears to work is to change the following code in wait():

for f in fs:
    f._waiters.remove(waiter)

to:

for f in fs:
    with f._condition:
        f._waiters.remove(waiter)
History
Date User Action Args
2014-01-21 00:18:39glangfordsetrecipients: + glangford
2014-01-21 00:18:39glangfordsetmessageid: <1390263519.32.0.357208079457.issue20319@psf.upfronthosting.co.za>
2014-01-21 00:18:39glangfordlinkissue20319 messages
2014-01-21 00:18:39glangfordcreate