@@ -118,14 +118,14 @@ static void job_destroy (void *data)
118118{
119119 struct job * job = data ;
120120 if (job ) {
121- json_decref (job -> exception_context );
121+ free (job -> ranks );
122+ free (job -> nodelist );
122123 json_decref (job -> annotations );
124+ grudgeset_destroy (job -> dependencies );
123125 json_decref (job -> jobspec_job );
124126 json_decref (job -> jobspec_cmd );
125127 json_decref (job -> R );
126- grudgeset_destroy (job -> dependencies );
127- free (job -> ranks );
128- free (job -> nodelist );
128+ json_decref (job -> exception_context );
129129 zlist_destroy (& job -> next_states );
130130 free (job );
131131 }
@@ -145,25 +145,27 @@ static struct job *job_create (struct list_ctx *ctx, flux_jobid_t id)
145145 return NULL ;
146146 job -> ctx = ctx ;
147147 job -> id = id ;
148- job -> state = FLUX_JOB_STATE_NEW ;
149148 job -> userid = FLUX_USERID_UNKNOWN ;
150- job -> ntasks = -1 ;
151- job -> nnodes = -1 ;
152149 job -> urgency = -1 ;
153- job -> expiration = -1.0 ;
154- job -> wait_status = -1 ;
155150 /* pending jobs that are not yet assigned a priority shall be
156151 * listed after those who do, so we set the job priority to MIN */
157152 job -> priority = FLUX_JOB_PRIORITY_MIN ;
153+ job -> state = FLUX_JOB_STATE_NEW ;
154+ job -> ntasks = -1 ;
155+ job -> nnodes = -1 ;
156+ job -> expiration = -1.0 ;
157+ job -> wait_status = -1 ;
158158 job -> result = FLUX_JOB_RESULT_FAILED ;
159- job -> eventlog_seq = -1 ;
160159
161160 if (!(job -> next_states = zlist_new ())) {
162161 errno = ENOMEM ;
163162 job_destroy (job );
164163 return NULL ;
165164 }
166165
166+ job -> states_mask = FLUX_JOB_STATE_NEW ;
167+ job -> states_events_mask = FLUX_JOB_STATE_NEW ;
168+ job -> eventlog_seq = -1 ;
167169 return job ;
168170}
169171
@@ -824,14 +826,16 @@ static void process_next_state (struct list_ctx *ctx, struct job *job)
824826 if (st -> state == FLUX_JOB_STATE_DEPEND ) {
825827 /* get initial jobspec */
826828 if (!(f = state_depend_lookup (jsctx , job ))) {
827- flux_log_error (jsctx -> h , "%s: state_depend_lookup" , __FUNCTION__ );
829+ flux_log_error (jsctx -> h , "%s: state_depend_lookup" ,
830+ __FUNCTION__ );
828831 return ;
829832 }
830833 }
831834 else { /* st->state == FLUX_JOB_STATE_RUN */
832835 /* get R to get node count, etc. */
833836 if (!(f = state_run_lookup (jsctx , job ))) {
834- flux_log_error (jsctx -> h , "%s: state_run_lookup" , __FUNCTION__ );
837+ flux_log_error (jsctx -> h , "%s: state_run_lookup" ,
838+ __FUNCTION__ );
835839 return ;
836840 }
837841 }
@@ -1231,14 +1235,12 @@ static int submit_context_parse (flux_t *h,
12311235{
12321236 int urgency ;
12331237 int userid ;
1234- int flags ;
12351238
12361239 if (!context
12371240 || json_unpack (context ,
1238- "{ s:i s:i s:i }" ,
1241+ "{ s:i s:i }" ,
12391242 "urgency" , & urgency ,
1240- "userid" , & userid ,
1241- "flags" , & flags ) < 0 ) {
1243+ "userid" , & userid ) < 0 ) {
12421244 flux_log (h , LOG_ERR , "%s: submit context invalid: %ju" ,
12431245 __FUNCTION__ , (uintmax_t )job -> id );
12441246 errno = EPROTO ;
0 commit comments