Skip to content

Commit c7197f3

Browse files
authored
Merge pull request #5853 from chu11/job_list_remove_dead_code
job-list: remove jobspec/R update dead code
2 parents 9ecf7b2 + b6466bf commit c7197f3

File tree

3 files changed

+11
-26
lines changed

3 files changed

+11
-26
lines changed

src/modules/job-list/job_data.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ void job_destroy (void *data)
4040
json_decref (job->jobspec);
4141
json_decref (job->R);
4242
json_decref (job->exception_context);
43-
json_decref (job->jobspec_updates);
44-
json_decref (job->R_updates);
4543
free (job);
4644
errno = save_errno;
4745
}

src/modules/job-list/job_data.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ struct job {
7777
unsigned int states_mask;
7878
unsigned int states_events_mask;
7979
void *list_handle;
80-
/* store updates that were received before jobspec/R objects */
81-
json_t *jobspec_updates;
82-
json_t *R_updates;
8380

8481
int submit_version; /* version number in submit context */
8582
};

src/modules/job-list/job_state.c

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ static void process_state_transition_update (struct job_state_ctx *jsctx,
288288
}
289289
if (state == FLUX_JOB_STATE_DEPEND) {
290290
// process job->jobspec which was obtained from journal
291-
if (job_parse_jobspec_cached (job, job->jobspec_updates) < 0) {
291+
if (job_parse_jobspec_cached (job, NULL) < 0) {
292292
flux_log_error (jsctx->h,
293293
"%s: error parsing jobspec",
294294
idf58 (job->id));
@@ -322,18 +322,13 @@ static void update_jobspec (struct job_state_ctx *jsctx,
322322
json_t *context,
323323
bool update_stats)
324324
{
325-
/* we have not loaded the jobspec yet, save off jobspec updates
326-
* for an update after jobspec retrieved
325+
/* It is theoretically possible an update could occur before the
326+
* jobspec is available. We don't handle it, just log an error.
327327
*/
328328
if (!job->jobspec) {
329-
if (!job->jobspec_updates)
330-
job->jobspec_updates = json_incref (context);
331-
else {
332-
if (json_object_update (job->jobspec_updates, context) < 0)
333-
flux_log (jsctx->h, LOG_INFO,
334-
"%s: job %s failed to update jobspec",
335-
__FUNCTION__, idf58 (job->id));
336-
}
329+
flux_log (jsctx->h, LOG_ERR,
330+
"%s: job %s received jobspec update before jobspec",
331+
__FUNCTION__, idf58 (job->id));
337332
return;
338333
}
339334

@@ -353,18 +348,13 @@ static void update_resource (struct job_state_ctx *jsctx,
353348
struct job *job,
354349
json_t *context)
355350
{
356-
/* we have not loaded the R yet, save off R updates
357-
* for an update after jobspec retrieved
351+
/* R should always be available at this point, outside of
352+
* testing scenarios.
358353
*/
359354
if (!job->R) {
360-
if (!job->R_updates)
361-
job->R_updates = json_incref (context);
362-
else {
363-
if (json_object_update (job->R_updates, context) < 0)
364-
flux_log (jsctx->h, LOG_INFO,
365-
"%s: job %s failed to update R",
366-
__FUNCTION__, idf58 (job->id));
367-
}
355+
flux_log (jsctx->h, LOG_ERR,
356+
"%s: job %s received resource update before R",
357+
__FUNCTION__, idf58 (job->id));
368358
return;
369359
}
370360

0 commit comments

Comments
 (0)