Skip to content

Commit 1597e9a

Browse files
authored
Merge pull request #320 from python-adaptive/fix/process-futs
call self._process_futures on canceled futures when BlockingRunner is done
2 parents 4f2200b + 69f6b36 commit 1597e9a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

adaptive/runner.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,10 @@ def _run(self):
412412
remaining = self._remove_unfinished()
413413
if remaining:
414414
concurrent.wait(remaining)
415+
# Some futures get their result set, despite being cancelled.
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)
415419
self._cleanup()
416420

417421
def elapsed_time(self):

0 commit comments

Comments
 (0)