Hi Thang,

Some comments inline.

Best Regards,
ThuanTr

-----Original Message-----
From: Thang Duc Nguyen <[email protected]> 
Sent: Tuesday, April 21, 2020 5:49 PM
To: Thuan Tran <[email protected]>; Minh Hon Chau 
<[email protected]>
Cc: [email protected]; Thang Duc Nguyen 
<[email protected]>
Subject: [PATCH 1/1] ntf: set operation invoke name to unknown if failed to get 
it [#3178]

If ntfimcnd is restarted during ccb modify, the modify callback
will not contain the invoke name( implementer name or admin owner name).
In this case, the invoke name will be set to "unknown" and the ntfimcnd
can continue with sending notification.

The notification will contain only op that receive by the ntfimcnd.
It means notification will lost the op before ntfimcnd restarted.
---
 src/ntf/ntfimcnd/ntfimcn_imm.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/ntf/ntfimcnd/ntfimcn_imm.c b/src/ntf/ntfimcnd/ntfimcn_imm.c
index 3c0a8c02a..2709b3337 100644
--- a/src/ntf/ntfimcnd/ntfimcn_imm.c
+++ b/src/ntf/ntfimcnd/ntfimcn_imm.c
@@ -376,9 +376,8 @@ get_operation_invoke_name_modify(SaImmOiCcbIdT ccbId,
                        goto done;
                }
        }
-       /* If we get here no name is found! */
-       LOG_ER("%s no name was found", __FUNCTION__);
-       osafassert(0);
+       osaf_extended_name_free(operation_invoke_name);

[Thuan] just free(operation_invoke_name) because osaf_extended_name_alloc() is 
not executed.
[Thuan] But instead of free() then check NULL outside this function to set 
"unknown", we can set inside this function.
               osaf_extended_name_alloc("unknown", operation_invoke_name);
[Thuan] Also do same change for get_operation_invoke_name_create()

+       operation_invoke_name = NULL;
 
 done:
        TRACE_LEAVE();
@@ -558,6 +557,12 @@ saImmOiCcbObjectModifyCallback(SaImmOiHandleT immOiHandle, 
SaImmOiCcbIdT ccbId,
                }
                invoke_name_ptr =
                    get_operation_invoke_name_modify(ccbId, attrMods);
+               // when ccb ntfimcnd restarted during ccb modification
+               if (invoke_name_ptr == NULL) {
+                       invoke_name_ptr = malloc(sizeof(SaNameT));
+                       osaf_extended_name_lend("unknown", invoke_name_ptr);
+               }
+
                ccbUtilCcbData->userData = invoke_name_ptr;
        }
 
-- 
2.17.1



_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to