Ack with some tiny inline comments.
Please merge attached patch, when I tested I found no log about this error case.

I also found #545 when testing...

Thanks,
Hans

> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> Sent: den 14 augusti 2013 14:41
> To: Hans Feldt; [email protected]
> 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;

Remove unnecessary assignment

> +        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) {

Reverse comparison (I know it is good for catching some errors but so ... 
awkward)

> +                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;
> +}
> +

Attachment: 542-hafe
Description: 542-hafe

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to