Skip to content

Commit 06dc5d0

Browse files
committed
only add results if done
1 parent 039680d commit 06dc5d0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

adaptive/runner.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,10 @@ def _run(self):
412412
remaining = self._remove_unfinished()
413413
if remaining:
414414
concurrent.wait(remaining)
415-
self._process_futures(remaining)
415+
# Some futures get their result set
416+
# see https://github.com/python-adaptive/adaptive/issues/319
417+
with_result = [f for f in remaining if not f.cancelled() and f.done()]
418+
self._process_futures(with_result)
416419
self._cleanup()
417420

418421
def elapsed_time(self):

0 commit comments

Comments
 (0)