Skip to content

Commit

Permalink
Handled removed target from workflow executor #1189
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo Peng committed Jan 27, 2019
1 parent de765b5 commit 226320f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/sos/step_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,11 @@ def run(self):
if e.message:
env.logger.info(e)
self.output_groups[proc_result['index']] = sos_targets([])
#elif isinstance(e, RemovedTarget):
#
# in theory, we should be able to handled removed target from here
# by rerunning the substep, but we it is too much work for this
# corner case. Let us simply rerunt he entire step.
else:
raise e
# if output is Undetermined, re-evalulate it
Expand Down
9 changes: 9 additions & 0 deletions src/sos/workflow_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,8 @@ def i_am():
runnable._child_socket.close()
elif isinstance(res, UnavailableLock):
self.handle_unavailable_lock(res, dag, runnable)
elif isinstance(res, RemovedTarget):
self.handle_unknown_target(res.target, dag, runnable)
# if the job is failed
elif isinstance(res, Exception):
env.logger.debug(f'{i_am()} received an exception')
Expand Down Expand Up @@ -1422,6 +1424,13 @@ def i_am():
f'{i_am()} receive a result {short_repr(res)}')
if isinstance(res, UnavailableLock):
self.handle_unavailable_lock(res, dag, runnable)
elif isinstance(res, RemovedTarget):
# RemovedTarget is usually hanled at the step level
# by sending a missing-target message here. However,
# if the exception is raised from substep workers, it is
# difficult for a substep to rerun particular substep
# so we handle it here by rerunning the entire step
self.handle_unknown_target(res.target, dag, runnable)
# if the job is failed
elif isinstance(res, Exception):
env.logger.debug(f'{i_am()} received an exception')
Expand Down

0 comments on commit 226320f

Please sign in to comment.