Skip to content

Commit

Permalink
job-manager/alloc: use common exception code
Browse files Browse the repository at this point in the history
Problem: alloc_response_cb() doesn't publish the job-exception
event message.

Use raise_job_exception() to avoid code duplication rather
than addressing the issue in situ.
  • Loading branch information
garlick committed Jul 6, 2023
1 parent f50f2c5 commit d2889f6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/modules/job-manager/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "event.h"
#include "drain.h"
#include "annotate.h"
#include "raise.h"
#include "queue.h"

struct alloc {
Expand Down Expand Up @@ -286,12 +287,12 @@ static void alloc_response_cb (flux_t *h, flux_msg_handler_t *mh,
__FUNCTION__,
idf58 (id));
}
if (event_job_post_pack (ctx->event, job, "exception", 0,
"{ s:s s:i s:I s:s }",
"type", "alloc",
"severity", 0,
"userid", (json_int_t) FLUX_USERID_UNKNOWN,
"note", note ? note : "") < 0)
if (raise_job_exception (ctx,
job,
"alloc",
0,
FLUX_USERID_UNKNOWN,
note) < 0)
goto teardown;
break;
case FLUX_SCHED_ALLOC_CANCEL:
Expand Down

0 comments on commit d2889f6

Please sign in to comment.