From 6e65b5cbf5cc3cd5611d4b54c709ebe5d5269016 Mon Sep 17 00:00:00 2001 From: Brian Christiansen <brian@schedmd.com> Date: Tue, 7 Jun 2016 14:13:04 -0600 Subject: [PATCH] Start ctld rpc manager before registering with dbd The dbd may need to send informaion back right after it registers (e.g. federation state). --- src/slurmctld/controller.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/slurmctld/controller.c b/src/slurmctld/controller.c index 4a70ea71df6..79ca87b5de9 100644 --- a/src/slurmctld/controller.c +++ b/src/slurmctld/controller.c @@ -534,6 +534,21 @@ int main(int argc, char *argv[]) trigger_primary_ctld_res_op(); } + /* + * create attached thread to process RPCs + * Create before registering so that the controller can listen + * to any updates from the dbd at startup. + */ + server_thread_incr(); + slurm_attr_init(&thread_attr); + while (pthread_create(&slurmctld_config.thread_id_rpc, + &thread_attr, _slurmctld_rpc_mgr, + NULL)) { + error("pthread_create error %m"); + sleep(1); + } + slurm_attr_destroy(&thread_attr); + clusteracct_storage_g_register_ctld( acct_db_conn, slurmctld_conf.slurmctld_port); @@ -553,19 +568,6 @@ int main(int argc, char *argv[]) if (slurm_mcs_init() != SLURM_SUCCESS) fatal("failed to initialize mcs plugin"); - /* - * create attached thread to process RPCs - */ - server_thread_incr(); - slurm_attr_init(&thread_attr); - while (pthread_create(&slurmctld_config.thread_id_rpc, - &thread_attr, _slurmctld_rpc_mgr, - NULL)) { - error("pthread_create error %m"); - sleep(1); - } - slurm_attr_destroy(&thread_attr); - /* * create attached thread for signal handling */ -- GitLab