Message208592
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) |
|
Date |
User |
Action |
Args |
2014-01-21 00:18:39 | glangford | set | recipients:
+ glangford |
2014-01-21 00:18:39 | glangford | set | messageid: <1390263519.32.0.357208079457.issue20319@psf.upfronthosting.co.za> |
2014-01-21 00:18:39 | glangford | link | issue20319 messages |
2014-01-21 00:18:39 | glangford | create | |
|