Issue #20319: concurrent.futures.wait() can block forever even if Futures have completed
Applied 403f8cf425
This commit is contained in:
parent
35e77648b7
commit
a6b180a71f
@ -227,6 +227,7 @@ def as_completed(fs, timeout=None):
|
||||
|
||||
finally:
|
||||
for f in fs:
|
||||
with f._condition:
|
||||
f._waiters.remove(waiter)
|
||||
|
||||
DoneAndNotDoneFutures = collections.namedtuple(
|
||||
@ -274,6 +275,7 @@ def wait(fs, timeout=None, return_when=ALL_COMPLETED):
|
||||
|
||||
waiter.event.wait(timeout)
|
||||
for f in fs:
|
||||
with f._condition:
|
||||
f._waiters.remove(waiter)
|
||||
|
||||
done.update(waiter.finished_futures)
|
||||
|
Loading…
Reference in New Issue
Block a user