Skip to content

Commit

Permalink
job-manager: publish event on jobtap exception
Browse files Browse the repository at this point in the history
Problem: the job manager publishes a job-exception event message
when an exception is raised via the job-manager.raise RPC, but not
when a jobtap plugin calls flux_jobtap_raise_exception().

Publish the job-exception event when a jobtap plugin calls
flux_jobtap_raise_exception().

Fixes flux-framework#5306
  • Loading branch information
garlick committed Jul 5, 2023
1 parent 0678fe5 commit b807f70
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/modules/job-manager/jobtap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1931,6 +1931,18 @@ static int jobtap_job_vraise (struct jobtap *jobtap,
char note [1024];
if (vsnprintf (note, sizeof (note), fmt, ap) >= sizeof (note))
note[sizeof(note) - 2] = '+';

flux_future_t *f;
if (!(f = flux_event_publish_pack (jobtap->ctx->h,
"job-exception",
FLUX_MSGFLAG_PRIVATE,
"{s:I s:s s:i}",
"id", job->id,
"type", type,
"severity", severity)))
return -1;
flux_future_destroy (f);

return event_job_post_pack (jobtap->ctx->event,
job, "exception", 0,
"{ s:s s:i s:i s:s }",
Expand Down

0 comments on commit b807f70

Please sign in to comment.