@@ -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