Skip to content

Commit

Permalink
Fix #7247 job_cmd log default_command exceptions (#7248)
Browse files Browse the repository at this point in the history
- The sleep is a workaround until we can decide what to do.
  • Loading branch information
robnagler authored Sep 11, 2024
1 parent 59b71d0 commit bccd32d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sirepo/pkcli/job_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def default_command(in_file):
Returns:
str: json output of command, e.g. status msg
"""
msg = None
try:
f = pkio.py_path(in_file)
msg = pkjson.load_any(f)
Expand All @@ -58,6 +59,16 @@ def default_command(in_file):
return
r = PKDict(res).pksetdefault(state=job.COMPLETED)
except Exception as e:
pkdlog(
"exception={} jobCmd={} simType={} stack={}",
e,
msg and msg.get("jobCmd"),
msg and msg.get("simulationType"),
pkdexc(),
)
# Workaround for sirepo#7247. Unlikely case, because _dispatch_compute already
# has a try.
time.sleep(0.3)
r = _maybe_parse_user_alert(e)
return pkjson.dump_pretty(r, pretty=False)

Expand Down

0 comments on commit bccd32d

Please sign in to comment.