diff --git a/src/plugins/sched/backfill/backfill.c b/src/plugins/sched/backfill/backfill.c index 0b78306ecf8963e5fe50148b4008cc64c0ae669c..c9ee5e499b1f8e8560b2688ccdb69b1c5fc75a2c 100644 --- a/src/plugins/sched/backfill/backfill.c +++ b/src/plugins/sched/backfill/backfill.c @@ -708,6 +708,8 @@ static int _attempt_backfill(void) } sort_job_queue(job_queue); while ((job_queue_rec = (job_queue_rec_t *) list_pop(job_queue))) { + if (slurmctld_config.shutdown_time) + break; if (((defer_rpc_cnt > 0) && (slurmctld_config.server_thread_count >= defer_rpc_cnt)) || ((time(NULL) - sched_start) >= sched_timeout)) { @@ -889,6 +891,8 @@ static int _attempt_backfill(void) /* Determine impact of any resource reservations */ later_start = now; TRY_LATER: + if (slurmctld_config.shutdown_time) + break; if (((defer_rpc_cnt > 0) && (slurmctld_config.server_thread_count >= defer_rpc_cnt)) || ((time(NULL) - sched_start) >= sched_timeout)) { diff --git a/src/slurmctld/controller.c b/src/slurmctld/controller.c index 92a96a5e6c8bb9a48707f4f1115469cbb7c2f3ed..8164520294df34ffae9e9d8b07736354cbc2317c 100644 --- a/src/slurmctld/controller.c +++ b/src/slurmctld/controller.c @@ -755,13 +755,16 @@ static void _init_config(void) * _slurm_rpc_reconfigure_controller function inside proc_req.c try * to keep these in sync. */ -static int _reconfigure_slurm(void) +static void _reconfigure_slurm(void) { /* Locks: Write configuration, job, node, and partition */ slurmctld_lock_t config_write_lock = { WRITE_LOCK, WRITE_LOCK, WRITE_LOCK, WRITE_LOCK }; int rc; + if (slurmctld_config.shutdown_time) + return; + /* * XXX - need to shut down the scheduler * plugin, re-read the configuration, and then @@ -783,8 +786,6 @@ static int _reconfigure_slurm(void) priority_g_reconfig(true); /* notify priority plugin too */ save_all_state(); /* Has own locking */ queue_job_scheduler(); - - return rc; } /* Request that the job scheduler execute soon (typically within seconds) */ diff --git a/src/slurmctld/job_scheduler.c b/src/slurmctld/job_scheduler.c index 09d5f06a2587678626d73221f5c5045665560f87..eff0b8585c6a1bfb4fd57c77c9955dfc432d23a3 100644 --- a/src/slurmctld/job_scheduler.c +++ b/src/slurmctld/job_scheduler.c @@ -753,6 +753,9 @@ extern int schedule(uint32_t job_limit) uint16_t reject_state_reason = WAIT_NO_REASON; DEF_TIMERS; + if (slurmctld_config.shutdown_time) + return 0; + if (sched_update != slurmctld_conf.last_update) { char *sched_params, *tmp_ptr; char *sched_type = slurm_get_sched_type(); diff --git a/src/slurmctld/proc_req.c b/src/slurmctld/proc_req.c index 12785dc329d4b7da101fc642c685e56a9902ec12..4fb4336a89b97e744f32c859fd744ea94ae8cacc 100644 --- a/src/slurmctld/proc_req.c +++ b/src/slurmctld/proc_req.c @@ -2576,7 +2576,7 @@ static void _slurm_rpc_reconfigure_controller(slurm_msg_t * msg) error("Security violation, RECONFIGURE RPC from uid=%d", uid); error_code = ESLURM_USER_ID_MISSING; } - if (in_progress) + if (in_progress || slurmctld_config.shutdown_time) error_code = EINPROGRESS; /* do RPC call */