From 978d15382fb5a1cf818edfa6e8fa23b2d3177f71 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Thu, 8 Jun 2017 08:34:27 +0200 Subject: [PATCH] F #4809: Load Hook managet earlier to be able to execute raft hooks on start --- src/nebula/Nebula.cc | 56 ++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/nebula/Nebula.cc b/src/nebula/Nebula.cc index b04fa318c5..f97b57ede2 100644 --- a/src/nebula/Nebula.cc +++ b/src/nebula/Nebula.cc @@ -689,8 +689,34 @@ void Nebula::start(bool bootstrap_only) Client::initialize("", get_master_oned(), msg_size, timeout); } - // ---- Raft Manager ---- + // ---- Hook Manager ---- + try + { + vector hm_mads; + nebula_configuration->get("HM_MAD", hm_mads); + + hm = new HookManager(hm_mads,vmpool); + } + catch (bad_alloc&) + { + throw; + } + + rc = hm->start(); + + if ( rc != 0 ) + { + throw runtime_error("Could not start the Hook Manager"); + } + + if (hm->load_mads(0) != 0) + { + goto error_mad; + } + + + // ---- Raft Manager ---- const VectorAttribute * raft_leader_hook; const VectorAttribute * raft_follower_hook; @@ -864,27 +890,6 @@ void Nebula::start(bool bootstrap_only) throw runtime_error("Could not start the Dispatch Manager"); } - // ---- Hook Manager ---- - try - { - vector hm_mads; - - nebula_configuration->get("HM_MAD", hm_mads); - - hm = new HookManager(hm_mads,vmpool); - } - catch (bad_alloc&) - { - throw; - } - - rc = hm->start(); - - if ( rc != 0 ) - { - throw runtime_error("Could not start the Hook Manager"); - } - // ---- Auth Manager ---- try { @@ -987,7 +992,7 @@ void Nebula::start(bool bootstrap_only) // Load mads // ----------------------------------------------------------- - sleep(1); + usleep(2500000); rc = 0; @@ -1006,11 +1011,6 @@ void Nebula::start(bool bootstrap_only) goto error_mad; } - if (hm->load_mads(0) != 0) - { - goto error_mad; - } - if (imagem->load_mads(0) != 0) { goto error_mad;