Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #7247 job_cmd log default_command exceptions #7248

Merged
merged 2 commits into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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