Hi Zoran,

ACK, Tested below case.

-AVM


On 6/30/2017 8:39 AM, A V Mahesh wrote:
Hi Zoran,

Thanks for the test case, I will test like below.

-AVM

On 6/29/2017 3:53 PM, Zoran Milinkovic wrote:
Hi Mahesh,

Try to set an implementer on a class with disabled long DN support.
When you create an instance of the class with long DN, OiDispatch should return ERR_BAD_HANDLE. After that, you will not be able to set a new implementer with the same name.

BR,
Zoran

-----Original Message-----
From: A V Mahesh [mailto:mahesh.va...@oracle.com]
Sent: den 29 juni 2017 05:39
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/1] imm: send imm finalize message to immnd when dispatch returns ERR_BAD_HANDLE [#2504]

Hi Zoran,

How you are able to catch this bug ?

Jut by manually seeing IMMND run-time size growing , while running threaded application !

-AVM


On 6/28/2017 7:32 PM, Zoran Milinkovic wrote:
Send IMM_FINALIZE message to immnd when dispatch functions returns ERR_BAD_HANDLE. IMM_FINALIZE will release all allocated resources of a handle on IMM service side.
---
src/imm/agent/imma_proc.cc | 51 ++++++++++++++++++++++++++++++++++++++++++++++
   1 file changed, 51 insertions(+)

diff --git a/src/imm/agent/imma_proc.cc b/src/imm/agent/imma_proc.cc
index 14ce5ab..dfd73e3 100644
--- a/src/imm/agent/imma_proc.cc
+++ b/src/imm/agent/imma_proc.cc
@@ -1745,6 +1745,7 @@ SaAisErrorT imma_hdl_callbk_dispatch_one(IMMA_CB *cb, SaImmHandleT immHandle) {
         imma_proc_ccbaug_setup(cl_node, callback);
         m_NCS_UNLOCK(&cb->cb_lock, NCS_LOCK_WRITE);
         if (!imma_process_callback_info(cb, cl_node, callback,
immHandle)) {
+        IMMSV_EVT finalize_evt, *out_evt;
           /* Callback protocol could not be honored due to some lack
of client capabilities. E.g. applier can not handle long DNs
              while regular OI can, or there is no regular OI. The
capabilties @@ -1757,6 +1758,22 @@ SaAisErrorT imma_hdl_callbk_dispatch_one(IMMA_CB *cb, SaImmHandleT immHandle) {
           */
           cl_node->stale = true;
           cl_node->exposed = true;
+
+        out_evt = NULL;
+        memset(&finalize_evt, 0, sizeof(IMMSV_EVT));
+        finalize_evt.type = IMMSV_EVT_TYPE_IMMND;
+        finalize_evt.info.immnd.type = IMMND_EVT_A2ND_IMM_FINALIZE;
+        finalize_evt.info.immnd.info.finReq.client_hdl =
+ cl_node->handle;
+
+        /* send the request to the IMMND */
+ imma_mds_msg_sync_send(cb->imma_mds_hdl, &(cb->immnd_mds_dest),
+                               &finalize_evt, &out_evt,
+                               cl_node->syncr_timeout);
+
+        if (out_evt) {
+          free(out_evt);
+        }
+
           return SA_AIS_ERR_BAD_HANDLE;
         }
         return SA_AIS_OK;
@@ -1810,6 +1827,7 @@ SaAisErrorT imma_hdl_callbk_dispatch_all(IMMA_CB *cb, SaImmHandleT immHandle) {
         imma_proc_ccbaug_setup(cl_node, callback);
         m_NCS_UNLOCK(&cb->cb_lock, NCS_LOCK_WRITE);
         if (!imma_process_callback_info(cb, cl_node, callback,
immHandle)) {
+        IMMSV_EVT finalize_evt, *out_evt;
           /* Callback protocol could not be honored due to some lack
of client capabilities. E.g. applier can not handle long DNs
              while regular OI can, or there is no regular OI. The
capabilties @@ -1822,6 +1840,22 @@ SaAisErrorT imma_hdl_callbk_dispatch_all(IMMA_CB *cb, SaImmHandleT immHandle) {
           */
           cl_node->stale = true;
           cl_node->exposed = true;
+
+        out_evt = NULL;
+        memset(&finalize_evt, 0, sizeof(IMMSV_EVT));
+        finalize_evt.type = IMMSV_EVT_TYPE_IMMND;
+        finalize_evt.info.immnd.type = IMMND_EVT_A2ND_IMM_FINALIZE;
+        finalize_evt.info.immnd.info.finReq.client_hdl =
+ cl_node->handle;
+
+        /* send the request to the IMMND */
+ imma_mds_msg_sync_send(cb->imma_mds_hdl, &(cb->immnd_mds_dest),
+                               &finalize_evt, &out_evt,
+                               cl_node->syncr_timeout);
+
+        if (out_evt) {
+          free(out_evt);
+        }
+
           return SA_AIS_ERR_BAD_HANDLE;
         }
       } else {
@@ -1903,6 +1937,7 @@ SaAisErrorT imma_hdl_callbk_dispatch_block(IMMA_CB *cb,
           imma_proc_ccbaug_setup(client_info, callback);
           m_NCS_UNLOCK(&cb->cb_lock, NCS_LOCK_WRITE);
           if (!imma_process_callback_info(cb, client_info, callback,
immHandle)) {
+          IMMSV_EVT finalize_evt, *out_evt;
             /* Callback protocol could not be honored due to some lack
of client capabilities. E.g. applier can not handle long DNs
                while regular OI can, or there is no regular OI. The
capabilties @@ -1915,6 +1950,22 @@ SaAisErrorT imma_hdl_callbk_dispatch_block(IMMA_CB *cb,
              */
             client_info->stale = true;
             client_info->exposed = true;
+
+          out_evt = NULL;
+          memset(&finalize_evt, 0, sizeof(IMMSV_EVT));
+          finalize_evt.type = IMMSV_EVT_TYPE_IMMND;
+          finalize_evt.info.immnd.type = IMMND_EVT_A2ND_IMM_FINALIZE;
+          finalize_evt.info.immnd.info.finReq.client_hdl =
+ client_info->handle;
+
+          /* send the request to the IMMND */
+ imma_mds_msg_sync_send(cb->imma_mds_hdl, &(cb->immnd_mds_dest),
+                                 &finalize_evt, &out_evt,
+ client_info->syncr_timeout);
+
+          if (out_evt) {
+            free(out_evt);
+          }
+
             return SA_AIS_ERR_BAD_HANDLE;
           }
         } else {



------------------------------------------------------------------------------
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

Reply via email to