Re: [devel] [PATCH 1/1] imm: Don't call exit() in IMM library [#2604]

2017-10-02 Thread Zoran Milinkovic
Hi Hung,

Ack from me.

Thanks,
Zoran

-Original Message-
From: Hung Nguyen [mailto:hung.d.ngu...@dektech.com.au] 
Sent: den 2 oktober 2017 08:47
To: Zoran Milinkovic 
Cc: opensaf-devel@lists.sourceforge.net; Hung Duc Nguyen 

Subject: [PATCH 1/1] imm: Don't call exit() in IMM library [#2604]

When PBE loses connection with IMMND, we don't call exit() in IMM library.
Instead, we mark the handle as exposed and then PBE will exit when it fails to 
call saImmOmDispatch.
---
 src/imm/agent/imma_db.cc | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/imm/agent/imma_db.cc b/src/imm/agent/imma_db.cc index 
cc771f7..d0e3682 100644
--- a/src/imm/agent/imma_db.cc
+++ b/src/imm/agent/imma_db.cc
@@ -685,11 +685,6 @@ void imma_mark_clients_stale(IMMA_CB *cb, bool 
mark_exposed) {
 temp_hdl = clnode->handle;
 temp_ptr = _hdl;
 
-if (clnode->isPbe) {
-  LOG_WA("PBE lost contact with parent IMMND - Exiting");
-  exit(1);
-}
-
 /* Process OM side CCBs */
 while ((ccb_node = (IMMA_CCB_NODE *)ncs_patricia_tree_getnext(
 >ccb_tree, (uint8_t *)ccb_temp_ptr))) { @@ -728,7 +723,11 
@@ void imma_mark_clients_stale(IMMA_CB *cb, bool mark_exposed) {
   continue;
 } /* No need to stale dispatched on this
  handle when already exposed. */
-if (mark_exposed) {
+if (clnode->isPbe) {
+  /* saImmOmDispatch will return ERR_BAD_HANDLE and PBE will exit */
+  LOG_WA("PBE lost contact with parent IMMND - marking handle as exposed");
+  clnode->exposed = true;
+} else if (mark_exposed) {
   clnode->exposed = true;
   LOG_WA("marking handle as exposed");
 } else if (clnode->isImmA2x12 && clnode->clmExposed) {
--
2.7.4


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1/1] imm: Don't call exit() in IMM library [#2604]

2017-10-02 Thread Hung Nguyen
When PBE loses connection with IMMND, we don't call exit() in IMM library.
Instead, we mark the handle as exposed and then PBE will exit when it fails to 
call saImmOmDispatch.
---
 src/imm/agent/imma_db.cc | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/imm/agent/imma_db.cc b/src/imm/agent/imma_db.cc
index cc771f7..d0e3682 100644
--- a/src/imm/agent/imma_db.cc
+++ b/src/imm/agent/imma_db.cc
@@ -685,11 +685,6 @@ void imma_mark_clients_stale(IMMA_CB *cb, bool 
mark_exposed) {
 temp_hdl = clnode->handle;
 temp_ptr = _hdl;
 
-if (clnode->isPbe) {
-  LOG_WA("PBE lost contact with parent IMMND - Exiting");
-  exit(1);
-}
-
 /* Process OM side CCBs */
 while ((ccb_node = (IMMA_CCB_NODE *)ncs_patricia_tree_getnext(
 >ccb_tree, (uint8_t *)ccb_temp_ptr))) {
@@ -728,7 +723,11 @@ void imma_mark_clients_stale(IMMA_CB *cb, bool 
mark_exposed) {
   continue;
 } /* No need to stale dispatched on this
  handle when already exposed. */
-if (mark_exposed) {
+if (clnode->isPbe) {
+  /* saImmOmDispatch will return ERR_BAD_HANDLE and PBE will exit */
+  LOG_WA("PBE lost contact with parent IMMND - marking handle as exposed");
+  clnode->exposed = true;
+} else if (mark_exposed) {
   clnode->exposed = true;
   LOG_WA("marking handle as exposed");
 } else if (clnode->isImmA2x12 && clnode->clmExposed) {
-- 
2.7.4


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel