diff --git a/cwltool/executors.py b/cwltool/executors.py index bfc87f9c7..3f350ebb5 100644 --- a/cwltool/executors.py +++ b/cwltool/executors.py @@ -29,7 +29,7 @@ from .context import RuntimeContext, getdefault from .cuda import cuda_version_and_device_count from .cwlprov.provenance_profile import ProvenanceProfile -from .errors import WorkflowException +from .errors import WorkflowException, WorkflowKillSwitch from .job import JobBase from .loghandler import _logger from .mutation import MutationManager @@ -260,6 +260,11 @@ def run_jobs( WorkflowException, ): # pylint: disable=try-except-raise raise + except WorkflowKillSwitch as err: + _logger.error( + f"Workflow kill switch activated by [job {err.job_id}] " + f"because on-error={runtime_context.on_error}" + ) except Exception as err: logger.exception("Got workflow error") raise WorkflowException(str(err)) from err @@ -332,6 +337,11 @@ def _runner( except WorkflowException as err: _logger.exception(f"Got workflow error: {err}") self.exceptions.append(err) + except WorkflowKillSwitch as err: + _logger.error( + f"Workflow kill switch activated by [job {err.job_id}] " + f"because on-error={runtime_context.on_error}" + ) except Exception as err: # pylint: disable=broad-except _logger.exception(f"Got workflow error: {err}") self.exceptions.append(WorkflowException(str(err))) @@ -466,9 +476,8 @@ def run_jobs( while self.taskqueue.in_flight > 0: self.wait_for_next_completion(runtime_context) self.run_job(None, runtime_context) - - runtime_context.workflow_eval_lock.release() finally: + runtime_context.workflow_eval_lock.release() self.taskqueue.drain() self.taskqueue.join()