From 86baeefb9ed90f0c61c1c616832c040fedd2a9dd Mon Sep 17 00:00:00 2001 From: jette <jette@schedmd.com> Date: Thu, 22 Aug 2013 13:30:41 -0700 Subject: [PATCH] Enable faster termination of backup controller on SIGTERM Previously there was a sleep(5) during which the backup controller was non responsive during its startup mode or returning from primary mode. --- src/slurmctld/backup.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/slurmctld/backup.c b/src/slurmctld/backup.c index fe5b1188834..d7727abbeaf 100644 --- a/src/slurmctld/backup.c +++ b/src/slurmctld/backup.c @@ -107,6 +107,7 @@ static int backup_sigarray[] = { * mode, assuming control when the primary controller stops responding */ void run_backup(void) { + int i; uint32_t trigger_type; time_t last_ping = 0; pthread_attr_t thread_attr_sig, thread_attr_rpc; @@ -149,7 +150,10 @@ void run_backup(void) trigger_type = TRIGGER_TYPE_BU_CTLD_RES_OP; _trigger_slurmctld_event(trigger_type); - sleep(5); /* Give the primary slurmctld set-up time */ + for (i = 0; ((i < 5) && (slurmctld_config.shutdown_time == 0)); i++) { + sleep(1); /* Give the primary slurmctld set-up time */ + } + /* repeatedly ping ControlMachine */ while (slurmctld_config.shutdown_time == 0) { sleep(1); -- GitLab