Skip to content

Commit

Permalink
Merge pull request #5955 from garlick/issue#5951
Browse files Browse the repository at this point in the history
job-manager: journal jobspec with submit event
  • Loading branch information
mergify[bot] committed May 10, 2024
2 parents 68e4791 + 39196ad commit fb85782
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/modules/job-list/job_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,11 +487,14 @@ static int journal_submit_event (struct job_state_ctx *jsctx,
struct job *job,
flux_jobid_t id,
double timestamp,
json_t *context)
json_t *context,
json_t *jobspec)
{
if (!job) {
if (!(job = job_create (jsctx->h, id)))
return -1;
if (jobspec)
job->jobspec = json_incref (jobspec);
if (zhashx_insert (jsctx->index, &job->id, job) < 0) {
job_destroy (job);
errno = EEXIST;
Expand Down Expand Up @@ -855,8 +858,6 @@ static int journal_process_event (struct job_state_ctx *jsctx,

job = zhashx_lookup (jsctx->index, &id);
if (job) {
if (!job->jobspec && jobspec)
job->jobspec = json_incref (jobspec);
if (!job->R && R)
job->R = json_incref (R);
}
Expand Down Expand Up @@ -899,7 +900,8 @@ static int journal_process_event (struct job_state_ctx *jsctx,
job,
id,
timestamp,
context) < 0)
context,
jobspec) < 0)
return -1;
}
else if (streq (name, "validate")) {
Expand Down
4 changes: 2 additions & 2 deletions src/modules/job-manager/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* responses will be for events that are are posted in real time.
*
* Additional responses contain at most one event. The redacted jobspec is
* included with the "validate" event. The redacted R object is included
* included with the "submit" event. The redacted R object is included
* with the "alloc" event.
*/

Expand Down Expand Up @@ -109,7 +109,7 @@ int journal_process_event (struct journal *journal,
"id", id,
"events", entry)))
goto error;
if (streq (name, "validate")) {
if (streq (name, "submit")) {
struct job *job;
if (!(job = zhashx_lookup (ctx->active_jobs, &id))
|| !job->jobspec_redacted
Expand Down

0 comments on commit fb85782

Please sign in to comment.