The shutdown function was invoked every time invoking the finalize function.
Try to shutdown the log agent only if the log client was finalized successfully.
---
 src/log/agent/lga_agent.cc | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/log/agent/lga_agent.cc b/src/log/agent/lga_agent.cc
index 393993f05..8c4f31e8f 100644
--- a/src/log/agent/lga_agent.cc
+++ b/src/log/agent/lga_agent.cc
@@ -757,7 +757,6 @@ SaAisErrorT LogAgent::saLogFinalize(SaLogHandleT logHandle) 
{
     }
   }
 
-done:
   if (CountClient() == 0) {
     // Stop recovery thread if it's running
     stop_recovery2_thread();
@@ -767,11 +766,14 @@ done:
       TRACE("lga_shutdown FAILED");
       ais_rc = SA_AIS_ERR_LIBRARY;
     }
-    m_NCS_SEL_OBJ_RMV_IND(&init_clm_status_sel_, true, false);
-    m_NCS_SEL_OBJ_RMV_IND(&log_server_up_sel_, true, false);
-    atomic_data_.waiting_log_server_up = true;
+    if (!atomic_data_.waiting_log_server_up) {
+      m_NCS_SEL_OBJ_RMV_IND(&init_clm_status_sel_, true, false);
+      m_NCS_SEL_OBJ_RMV_IND(&log_server_up_sel_, true, false);
+      atomic_data_.waiting_log_server_up = true;
+    }
   }
 
+done:
   TRACE_LEAVE2("ais_rc = %s", saf_error(ais_rc));
   return ais_rc;
 }
-- 
2.17.1



_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to