diff --git a/NEWS b/NEWS index e28b7b68c3e92d5b39d8479c378ede0d312ec3b3..5f5cc22184e2abeb77a1263b0684d205416bf581 100644 --- a/NEWS +++ b/NEWS @@ -168,6 +168,7 @@ documents those changes that are of interest to users and admins. - Add squeue option to print a job step's task count (-o %A). - Initialize forward_struct to avoid trying to free a bad pointer, patch from Anton Blanchard (SAMBA). + - In sched/wiki2, fix fatal race condition on slurmctld startup. * Changes in SLURM 1.1.21 ========================= diff --git a/src/plugins/sched/wiki/get_jobs.c b/src/plugins/sched/wiki/get_jobs.c index 234b5122cfe1655a4e12684d679cc9cd736a5114..2b067b31ace63ad7e01d3af91660c897864ebbf7 100644 --- a/src/plugins/sched/wiki/get_jobs.c +++ b/src/plugins/sched/wiki/get_jobs.c @@ -99,6 +99,12 @@ extern int get_jobs(char *cmd_ptr, int *err_code, char **err_msg) error("wiki: GETJOBS has invalid ARG value"); return -1; } + if (job_list == NULL) { + *err_code = -140; + *err_msg = "Still performing initialization"; + error("wiki: job_list not yet initilized"); + return -1; + } tmp_char++; lock_slurmctld(job_read_lock); if (update_time == 0) diff --git a/src/plugins/sched/wiki2/get_jobs.c b/src/plugins/sched/wiki2/get_jobs.c index eabd601143252dda3648af207057e8ceac30e3f8..34b3598151844bd47ac436226747580447720c9a 100644 --- a/src/plugins/sched/wiki2/get_jobs.c +++ b/src/plugins/sched/wiki2/get_jobs.c @@ -99,6 +99,12 @@ extern int get_jobs(char *cmd_ptr, int *err_code, char **err_msg) error("wiki: GETJOBS has invalid ARG value"); return -1; } + if (job_list == NULL) { + *err_code = -140; + *err_msg = "Still performing initialization"; + error("wiki: job_list not yet initilized"); + return -1; + } tmp_char++; lock_slurmctld(job_read_lock); if (update_time == 0)