Skip to content

Commit

Permalink
Issue #20319: concurrent.futures.wait() can block forever even if Fut…
Browse files Browse the repository at this point in the history
…ures have completed
  • Loading branch information
brianquinlan committed Feb 1, 2014
1 parent 2d1140e commit 403f8cf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Lib/concurrent/futures/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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
----

Expand Down

0 comments on commit 403f8cf

Please sign in to comment.