From eeb8952bc31551c4af0b44e7e519ce90b9995d72 Mon Sep 17 00:00:00 2001 From: Thanh Son Phung Date: Thu, 26 Oct 2023 15:57:51 -0400 Subject: [PATCH] vine chain excp (#2926) --- parsl/executors/taskvine/executor.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/parsl/executors/taskvine/executor.py b/parsl/executors/taskvine/executor.py index ac9681f9b7..788616fd8a 100644 --- a/parsl/executors/taskvine/executor.py +++ b/parsl/executors/taskvine/executor.py @@ -643,14 +643,22 @@ def _collect_taskvine_results(self): with open(task_report.result_file, 'rb') as f_in: result = deserialize(f_in.read()) except Exception as e: - logger.debug(f'Cannot load result from result file {task_report.result_file}. Exception: {e}') - future.set_exception(TaskVineTaskFailure('Cannot load result from result file', None)) + logger.error(f'Cannot load result from result file {task_report.result_file}. Exception: {e}') + ex = TaskVineTaskFailure('Cannot load result from result file', None) + ex.__cause__ = e + future.set_exception(ex) else: - future.set_result(result) + if isinstance(result, Exception): + ex = TaskVineTaskFailure('Task execution raises an exception', result) + ex.__cause__ = result + future.set_exception(ex) + else: + future.set_result(result) else: # If there are no results, then the task failed according to one of # taskvine modes, such as resource exhaustion. - future.set_exception(TaskVineTaskFailure(task_report.reason, None)) + ex = TaskVineTaskFailure(task_report.reason, None) + future.set_exception(ex) # decrement outstanding task counter with self._outstanding_tasks_lock: