With 2N app model with NPI SU in PI SU, the PI components
is terminated following by lock command on SU. The SU will
be in uninstantiated presence state. And there is no action
can repair the SU. This issue due to during lock the SU,
the NPI component terminated while the SU in restarting.
And it will force to terminate all the PI componentsin the
SU and move the SU to uninstantiated pres state.

The fix is to remove this force.
---
 src/amf/amfnd/avnd_su.h |  2 ++
 src/amf/amfnd/clc.cc    | 13 +++++++++++++
 src/amf/amfnd/susm.cc   | 33 ++-------------------------------
 3 files changed, 17 insertions(+), 31 deletions(-)

diff --git a/src/amf/amfnd/avnd_su.h b/src/amf/amfnd/avnd_su.h
index 46a711fc9..7abfbab64 100644
--- a/src/amf/amfnd/avnd_su.h
+++ b/src/amf/amfnd/avnd_su.h
@@ -262,6 +262,8 @@ typedef struct avnd_su_tag {
   (SA_AMF_PRESENCE_INSTANTIATED == (x)->pres)
 #define m_AVND_SU_PRES_STATE_IS_INSTANTIATING(x) \
   (SA_AMF_PRESENCE_INSTANTIATING == (x)->pres)
+#define m_AVND_SU_PRES_STATE_IS_UNINSTANTIATED(x) \
+  (SA_AMF_PRESENCE_UNINSTANTIATED == (x)->pres)
 
 /* pre-configured su params */
 #define AVND_SU_FLAG_RESTART_DIS 0x00000001
diff --git a/src/amf/amfnd/clc.cc b/src/amf/amfnd/clc.cc
index 0b0d62634..3fdfa8061 100644
--- a/src/amf/amfnd/clc.cc
+++ b/src/amf/amfnd/clc.cc
@@ -336,6 +336,7 @@ uint32_t avnd_evt_clc_resp_evh(AVND_CB *cb, AVND_EVT *evt) {
   AVND_COMP_CLC_PRES_FSM_EV ev = AVND_COMP_CLC_PRES_FSM_EV_MAX;
   AVND_CLC_EVT *clc_evt = &evt->info.clc;
   AVND_COMP *comp = 0;
+  AVND_SU *su = 0;
   uint32_t rc = NCSCC_RC_SUCCESS;
   TRACE_ENTER();
 
@@ -347,6 +348,18 @@ uint32_t avnd_evt_clc_resp_evh(AVND_CB *cb, AVND_EVT *evt) 
{
     goto done;
   }
 
+  if (comp) {
+    su = avnd_sudb_rec_get(cb->sudb, comp->su->name);
+    if (su && m_AVND_SU_PRES_STATE_IS_UNINSTANTIATED(su) &&
+      (clc_evt->cmd_type == AVND_COMP_CLC_CMD_TYPE_INSTANTIATE)) {
+      LOG_NO("Ignore Inst respond command. Component should be terminated");
+      rc = avnd_comp_clc_cmd_execute(cb, comp, 
AVND_COMP_CLC_CMD_TYPE_TERMINATE);
+      m_AVND_COMP_REG_PARAM_RESET(cb, comp);
+
+      goto done;
+    }
+  }
+
   TRACE("'%s', command type:%s", comp->name.c_str(),
         clc_cmd_type[clc_evt->cmd_type]);
 
diff --git a/src/amf/amfnd/susm.cc b/src/amf/amfnd/susm.cc
index 4f946b996..a4f0fdb88 100644
--- a/src/amf/amfnd/susm.cc
+++ b/src/amf/amfnd/susm.cc
@@ -3586,8 +3586,8 @@ done:
 /****************************************************************************
   Name          : avnd_su_pres_restart_compterming_hdler
 
-  Description   : This routine processes the `SU Terminate` event in
-                  `Instantiating` state.
+  Description   : This routine processes the `Comp Terminating` event in
+                  `Restarting` state.
 
   Arguments     : cb   - ptr to the AvND control block
                   su   - ptr to the su
@@ -3602,7 +3602,6 @@ done:
 ******************************************************************************/
 uint32_t avnd_su_pres_restart_compterming_hdler(AVND_CB *cb, AVND_SU *su,
                                                 AVND_COMP *comp) {
-  AVND_COMP *curr_comp = 0;
   uint32_t rc = NCSCC_RC_SUCCESS;
   const std::string compname = comp ? comp->name : "none";
   TRACE_ENTER2("SUTerminate event in the Instantiating state:'%s' : '%s'",
@@ -3619,34 +3618,6 @@ uint32_t avnd_su_pres_restart_compterming_hdler(AVND_CB 
*cb, AVND_SU *su,
     goto done;
   }
 
-  /*
-   * If pi su, pick all the instantiated/instantiating pi comps &
-   * trigger their FSM with TermEv.
-   */
-  for (curr_comp = m_AVND_COMP_FROM_SU_DLL_NODE_GET(
-           m_NCS_DBLIST_FIND_FIRST(&su->comp_list));
-       curr_comp; curr_comp = m_AVND_COMP_FROM_SU_DLL_NODE_GET(
-                      m_NCS_DBLIST_FIND_NEXT(&curr_comp->su_dll_node))) {
-    /* skip the npi comps */
-    if (!m_AVND_COMP_TYPE_IS_PREINSTANTIABLE(curr_comp)) continue;
-
-    /* terminate the non-uninstantiated pi comp */
-    if (!m_AVND_COMP_PRES_STATE_IS_UNINSTANTIATED(curr_comp) &&
-        (!m_AVND_COMP_PRES_STATE_IS_TERMINATING(curr_comp))) {
-      /* mark the comp failed */
-      m_AVND_COMP_FAILED_SET(curr_comp);
-
-      /* update comp oper state */
-      m_AVND_COMP_OPER_STATE_SET(curr_comp, SA_AMF_OPERATIONAL_DISABLED);
-      rc = avnd_comp_oper_state_avd_sync(cb, curr_comp);
-      if (NCSCC_RC_SUCCESS != rc) goto done;
-
-      rc = avnd_comp_clc_fsm_run(cb, curr_comp,
-                                 AVND_COMP_CLC_PRES_FSM_EV_CLEANUP);
-      if (NCSCC_RC_SUCCESS != rc) goto done;
-    }
-  } /* for */
-
   /* transition to terminating state */
   avnd_su_pres_state_set(cb, su, SA_AMF_PRESENCE_TERMINATING);
 
-- 
2.25.1



_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to