Skip to content
Snippets Groups Projects
Commit 86baeefb authored by jette's avatar jette
Browse files

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.
parent c962ef6e
No related branches found
No related tags found
No related merge requests found
...@@ -107,6 +107,7 @@ static int backup_sigarray[] = { ...@@ -107,6 +107,7 @@ static int backup_sigarray[] = {
* mode, assuming control when the primary controller stops responding */ * mode, assuming control when the primary controller stops responding */
void run_backup(void) void run_backup(void)
{ {
int i;
uint32_t trigger_type; uint32_t trigger_type;
time_t last_ping = 0; time_t last_ping = 0;
pthread_attr_t thread_attr_sig, thread_attr_rpc; pthread_attr_t thread_attr_sig, thread_attr_rpc;
...@@ -149,7 +150,10 @@ void run_backup(void) ...@@ -149,7 +150,10 @@ void run_backup(void)
trigger_type = TRIGGER_TYPE_BU_CTLD_RES_OP; trigger_type = TRIGGER_TYPE_BU_CTLD_RES_OP;
_trigger_slurmctld_event(trigger_type); _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 */ /* repeatedly ping ControlMachine */
while (slurmctld_config.shutdown_time == 0) { while (slurmctld_config.shutdown_time == 0) {
sleep(1); sleep(1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment