Hi Thuan,
Thanks for your comment.
See my respond inline.

-----Original Message-----
From: Thuan Tran <thuan.t...@dektech.com.au> 
Sent: Wednesday, April 22, 2020 9:41 AM
To: Thang Duc Nguyen <thang.d.ngu...@dektech.com.au>; Minh Hon Chau 
<minh.c...@dektech.com.au>
Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [PATCH 1/1] ntf: set operation invoke name to unknown if failed to 
get it [#3178]

Hi Thang,

Some comments inline.

Best Regards,
ThuanTr

-----Original Message-----
From: Thang Duc Nguyen <thang.d.ngu...@dektech.com.au>
Sent: Tuesday, April 21, 2020 5:49 PM
To: Thuan Tran <thuan.t...@dektech.com.au>; Minh Hon Chau 
<minh.c...@dektech.com.au>
Cc: opensaf-devel@lists.sourceforge.net; Thang Duc Nguyen 
<thang.d.ngu...@dektech.com.au>
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);
[Thang]: OK. I will update it.

 [Thuan] Also do same change for get_operation_invoke_name_create()
[Thang]: The issue only in modify object. Create object not meet this issue.

+       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
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to