Skip to content

Commit 9d817a5

Browse files
committed
ensure completed tasks retrieve exceptions
1 parent f20fc23 commit 9d817a5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pydra/engine/workers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ def run(self, task: "Task[DefType]", rerun: bool = False) -> "Result":
5151
async def run_async(self, task: "Task[DefType]", rerun: bool = False) -> "Result":
5252
assert self.is_async, "Worker is not asynchronous"
5353
if task.is_async: # only for workflows at this stage and the foreseeable
54-
# These jobs are run in the primary process but farm out the workflows jobs
54+
# These jobs are run in the primary process but potentially farm out
55+
# workflow jobs to other processes/job-schedulers
5556
return await task.run_async(rerun=rerun)
5657
else:
5758
return await self.run(task=task, rerun=rerun)
@@ -91,6 +92,9 @@ async def fetch_finished(self, futures):
9192
except ValueError:
9293
# nothing pending!
9394
pending = set()
95+
# ensure exceptions are raised from completed tasks
96+
for task in done:
97+
task.result()
9498
logger.debug(f"Tasks finished: {len(done)}")
9599
return pending
96100

0 commit comments

Comments
 (0)