Ack.
Thanks
-Nagu
-----Original Message-----
From: Praveen Malviya
Sent: 14 August 2013 18:11
To: [email protected]; Nagendra Kumar
Cc: [email protected]
Subject: [PATCH 1 of 1] amfnd: handle avaDown event in RESTARTING state [#542]
osaf/services/saf/avsv/avnd/avnd_clc.c | 37 +++++++++++++++++++++++++++++++++-
1 files changed, 36 insertions(+), 1 deletions(-)
If a component crashes or exits in restarting state then AMF should clean up
the component.
Also if cleanup is successful, component should be instantiated. This patch
will help in handling
component restart event in the restarting state of the component.
diff --git a/osaf/services/saf/avsv/avnd/avnd_clc.c
b/osaf/services/saf/avsv/avnd/avnd_clc.c
--- a/osaf/services/saf/avsv/avnd/avnd_clc.c
+++ b/osaf/services/saf/avsv/avnd/avnd_clc.c
@@ -63,6 +63,7 @@ static uint32_t avnd_comp_clc_restart_te
static uint32_t avnd_comp_clc_restart_termfail_hdler(AVND_CB *, AVND_COMP *);
static uint32_t avnd_comp_clc_restart_clean_hdler(AVND_CB *, AVND_COMP *);
static uint32_t avnd_comp_clc_restart_cleanfail_hdler(AVND_CB *, AVND_COMP *);
+static uint32_t avnd_comp_clc_restart_restart_hdler(AVND_CB *cb, AVND_COMP
*comp);
static uint32_t avnd_comp_clc_orph_instsucc_hdler(AVND_CB *, AVND_COMP *);
static uint32_t avnd_comp_clc_orph_term_hdler(AVND_CB *, AVND_COMP *);
static uint32_t avnd_comp_clc_orph_clean_hdler(AVND_CB *, AVND_COMP *);
@@ -150,7 +151,7 @@ static AVND_COMP_CLC_FSM_FN avnd_comp_cl
avnd_comp_clc_restart_clean_hdler, /* CLEANUP EV */
avnd_comp_clc_xxxing_cleansucc_hdler, /* CLEANUP_SUCC EV */
avnd_comp_clc_restart_cleanfail_hdler, /* CLEANUP_FAIL EV */
- 0, /* RESTART EV */
+ avnd_comp_clc_restart_restart_hdler, /* RESTART EV */
0, /* ORPH EV */
},
@@ -2835,3 +2836,37 @@ uint32_t avnd_instfail_su_failover(AVND_
return rc;
}
+
+/**
+ * @brief This function processes component restart event in RESTARTING
state.
+ *
+ * @param ptr to avnd_cb
+ * @param ptr to component
+ *
+ * @return NCSCC_RC_FAILURE/NCSCC_RC_SUCCESS
+ */
+static uint32_t avnd_comp_clc_restart_restart_hdler(AVND_CB *cb, AVND_COMP
*comp)
+{
+ uint32_t rc = NCSCC_RC_SUCCESS;
+ TRACE_ENTER2("'%s': Restart event in the restarting state",
comp->name.value);
+
+ if (m_AVND_COMP_TYPE_IS_PROXIED(comp))
+ avnd_comp_cbq_del(cb, comp, true);
+
+ if (m_AVND_COMP_TYPE_IS_PROXIED(comp) && comp->pxy_comp != 0)
+ rc = avnd_comp_cbk_send(cb, comp, AVSV_AMF_PXIED_COMP_CLEAN,
0, 0);
+ else
+ rc = avnd_comp_clc_cmd_execute(cb, comp,
AVND_COMP_CLC_CMD_TYPE_CLEANUP);
+
+ if (NCSCC_RC_SUCCESS == rc) {
+ if (!m_AVND_COMP_TYPE_IS_PROXIED(comp))
+ m_AVND_COMP_REG_PARAM_RESET(cb, comp);
+ m_AVND_COMP_CLC_INST_PARAM_RESET(comp);
+
+ m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, comp,
AVND_CKPT_COMP_CONFIG);
+ }
+
+ TRACE_LEAVE();
+ return rc;
+}
+
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel