Skip to content

Commit

Permalink
Merge pull request #5853 from chu11/job_list_remove_dead_code
Browse files Browse the repository at this point in the history
job-list: remove jobspec/R update dead code
  • Loading branch information
mergify[bot] committed Apr 3, 2024
2 parents 9ecf7b2 + b6466bf commit c7197f3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 26 deletions.
2 changes: 0 additions & 2 deletions src/modules/job-list/job_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ void job_destroy (void *data)
json_decref (job->jobspec);
json_decref (job->R);
json_decref (job->exception_context);
json_decref (job->jobspec_updates);
json_decref (job->R_updates);
free (job);
errno = save_errno;
}
Expand Down
3 changes: 0 additions & 3 deletions src/modules/job-list/job_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ struct job {
unsigned int states_mask;
unsigned int states_events_mask;
void *list_handle;
/* store updates that were received before jobspec/R objects */
json_t *jobspec_updates;
json_t *R_updates;

int submit_version; /* version number in submit context */
};
Expand Down
32 changes: 11 additions & 21 deletions src/modules/job-list/job_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ static void process_state_transition_update (struct job_state_ctx *jsctx,
}
if (state == FLUX_JOB_STATE_DEPEND) {
// process job->jobspec which was obtained from journal
if (job_parse_jobspec_cached (job, job->jobspec_updates) < 0) {
if (job_parse_jobspec_cached (job, NULL) < 0) {
flux_log_error (jsctx->h,
"%s: error parsing jobspec",
idf58 (job->id));
Expand Down Expand Up @@ -322,18 +322,13 @@ static void update_jobspec (struct job_state_ctx *jsctx,
json_t *context,
bool update_stats)
{
/* we have not loaded the jobspec yet, save off jobspec updates
* for an update after jobspec retrieved
/* It is theoretically possible an update could occur before the
* jobspec is available. We don't handle it, just log an error.
*/
if (!job->jobspec) {
if (!job->jobspec_updates)
job->jobspec_updates = json_incref (context);
else {
if (json_object_update (job->jobspec_updates, context) < 0)
flux_log (jsctx->h, LOG_INFO,
"%s: job %s failed to update jobspec",
__FUNCTION__, idf58 (job->id));
}
flux_log (jsctx->h, LOG_ERR,
"%s: job %s received jobspec update before jobspec",
__FUNCTION__, idf58 (job->id));
return;
}

Expand All @@ -353,18 +348,13 @@ static void update_resource (struct job_state_ctx *jsctx,
struct job *job,
json_t *context)
{
/* we have not loaded the R yet, save off R updates
* for an update after jobspec retrieved
/* R should always be available at this point, outside of
* testing scenarios.
*/
if (!job->R) {
if (!job->R_updates)
job->R_updates = json_incref (context);
else {
if (json_object_update (job->R_updates, context) < 0)
flux_log (jsctx->h, LOG_INFO,
"%s: job %s failed to update R",
__FUNCTION__, idf58 (job->id));
}
flux_log (jsctx->h, LOG_ERR,
"%s: job %s received resource update before R",
__FUNCTION__, idf58 (job->id));
return;
}

Expand Down

0 comments on commit c7197f3

Please sign in to comment.