Hi Praveen ack, minor commets below:
> On 9 Jun 2016, at 8:45 PM, [email protected] wrote: > > osaf/services/saf/amf/amfd/nodegroup.cc | 10 ++++++++++ > osaf/services/saf/amf/amfd/su.cc | 12 +++++++++++- > 2 files changed, 21 insertions(+), 1 deletions(-) > > > Note: This patch is work of Hans N and it is for the crash given in the > description of > ticket #1766. > > When running SMF tests that creates and deletes nodegrups, > the nodegroup_db sometimes do not contain the nodegroup given in > parameter opdata->objectName. > > diff --git a/osaf/services/saf/amf/amfd/nodegroup.cc > b/osaf/services/saf/amf/amfd/nodegroup.cc > --- a/osaf/services/saf/amf/amfd/nodegroup.cc > +++ b/osaf/services/saf/amf/amfd/nodegroup.cc > @@ -453,6 +453,11 @@ static SaAisErrorT ng_ccb_completed_dele > AVD_AVND *node; > AVD_AMF_NG *ng = avd_ng_get(&opdata->objectName); > > + if (ng == nullptr) { > + LOG_WA("Could not find %s in nodegroup_db", > opdata->objectName.value); > + return SA_AIS_OK; > + } > + > TRACE_ENTER2("%u", ng->number_nodes()); > std::set<std::string>::const_iterator iter; > if ((ng->saAmfNGAdminState != SA_AMF_ADMIN_LOCKED) && > @@ -581,6 +586,11 @@ static void ng_ccb_apply_delete_hdlr(Ccb > { > TRACE_ENTER(); > AVD_AMF_NG *ng = avd_ng_get(&opdata->objectName); > + if (ng == nullptr) { > + LOG_WA("Could not find %s in nodegroup_db", > opdata->objectName.value); [GL] missing TRACE_LEAVE > + return; > + } > + > SaAmfAdminStateT old_admin_state = ng->saAmfNGAdminState; > if (avd_cb->avail_state_avd != SA_AMF_HA_ACTIVE) { > //Since AMF will delete NG, clear its pointers in node. > diff --git a/osaf/services/saf/amf/amfd/su.cc > b/osaf/services/saf/amf/amfd/su.cc > --- a/osaf/services/saf/amf/amfd/su.cc > +++ b/osaf/services/saf/amf/amfd/su.cc > @@ -457,6 +457,10 @@ static AVD_AVND *map_su_to_node(AVD_SU * > /* If node is configured in SU we are done */ > if (strstr((char *)su->saAmfSUHostNodeOrNodeGroup.value, "safAmfNode=") > != nullptr) { > node = avd_node_get(&su->saAmfSUHostNodeOrNodeGroup); > + if (node == nullptr) { > + LOG_WA("Could not find: %s in su: %s", > su->saAmfSUHostNodeOrNodeGroup.value, su->name.value); > + return node; [GL] missing TRACE_LEAVE > + } > goto done; > } > > @@ -495,7 +499,13 @@ static AVD_AVND *map_su_to_node(AVD_SU * > } > > /* All nodes already have an SU mapped for the SG. Return a node in the > node group. */ > - node = avd_node_get(*ng->saAmfNGNodeList.begin()); > + node_iter = ng->saAmfNGNodeList.begin(); > + if (node_iter != ng->saAmfNGNodeList.end()) { > + node = avd_node_get(*ng->saAmfNGNodeList.begin()); > + } else { [GL] missing TRACE_LEAVE > + LOG_WA("%s is empty", su->saAmfSUHostNodeOrNodeGroup.value); > + return nullptr; > + } > done: > memcpy(&su->saAmfSUHostedByNode, &node->name, sizeof(SaNameT)); > TRACE_LEAVE2("hosted by %s", node->name.value); ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e _______________________________________________ Opensaf-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel
