Skip to content

Commit

Permalink
hardened handling result in jobber
Browse files Browse the repository at this point in the history
  • Loading branch information
godfryd committed Oct 23, 2021
1 parent 2308715 commit 43972e9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions agent/kraken/agent/jobber.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,15 @@ def _run_step(srv, exec_ctx, job_dir, job_id, idx, step, tools, deadline):
if cancel:
log.info('canceling job')
return 'cancel', cancel, bg_step

if 'status' not in result:
msg = 'missing status in result: %s' % str(result)
log.error(msg)
if not result:
result = {}
result['status'] = 'error'
result['reason'] = msg

if result['status'] == 'done':
break
retry_info = 'no more retries' if n + 1 == attempts else ('retrying after %ds' % sleep_time_after_attempt)
Expand Down

0 comments on commit 43972e9

Please sign in to comment.