Commit 403f8cf4 authored by Brian Quinlan's avatar Brian Quinlan

Issue #20319: concurrent.futures.wait() can block forever even if Futures have completed

parent 2d1140e8
......@@ -225,7 +225,8 @@ def as_completed(fs, timeout=None):
finally:
for f in fs:
f._waiters.remove(waiter)
with f._condition:
f._waiters.remove(waiter)
DoneAndNotDoneFutures = collections.namedtuple(
'DoneAndNotDoneFutures', 'done not_done')
......@@ -272,7 +273,8 @@ def wait(fs, timeout=None, return_when=ALL_COMPLETED):
waiter.event.wait(timeout)
for f in fs:
f._waiters.remove(waiter)
with f._condition:
f._waiters.remove(waiter)
done.update(waiter.finished_futures)
return DoneAndNotDoneFutures(done, set(fs) - done)
......
......@@ -69,6 +69,12 @@ Library
- Issue #17481: inspect.getfullargspec() now uses inspect.signature() API.
- Issue #15304: concurrent.futures.wait() can block forever even if
Futures have completed. Patch by Glenn Langford.
Fix warning message when `os.chdir()` fails inside
`test.support.temp_cwd()`. Patch by Chris Jerdonek.
IDLE
----
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment