On 7 August 2013 14:14,  <praveen.malv...@oracle.com> wrote:
>  osaf/services/saf/avsv/avnd/avnd_clc.c         |  93 
> +++++++++++--------------
>  osaf/services/saf/avsv/avnd/include/avnd_evt.h |   2 -
>  2 files changed, 40 insertions(+), 55 deletions(-)
>
>
> At present when clc response event comes AMFND searches whole component
> database and matches the context. This context does not include component
> name. Thus AMFND can associate clc response with wrong component. The patch
> ensures that AMFND gets component name in the clc response event and thus
> solves the problem by associating clc response event with 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
> @@ -70,7 +70,6 @@ static uint32_t avnd_comp_clc_orph_resta
>
>  uint32_t avnd_comp_clc_st_chng_prc(AVND_CB *, AVND_COMP *, 
> SaAmfPresenceStateT, SaAmfPresenceStateT);
>
> -static uint32_t avnd_comp_clc_resp(NCS_OS_PROC_EXECUTE_TIMED_CB_INFO *);
>  static uint32_t avnd_instfail_su_failover(AVND_CB *, AVND_SU *, AVND_COMP *);
>
>  /***************************************************************************
> @@ -311,33 +310,20 @@ uint32_t avnd_evt_clc_resp_evh(AVND_CB *
>         AVND_CLC_EVT *clc_evt = &evt->info.clc;
>         AVND_COMP *comp = 0;
>         uint32_t rc = NCSCC_RC_SUCCESS;
> -       uint32_t amcmd = 0;
>         TRACE_ENTER();
>
> -       /* get the comp */
> -       if (clc_evt->exec_ctxt) {
> -               /* => cmd successfully launched (scan the entire 
> comp-database) */
> -               for (comp = (AVND_COMP 
> *)ncs_patricia_tree_getnext(&cb->compdb,
> -                                                                  (uint8_t 
> *)0); comp;
> -                    comp = (AVND_COMP 
> *)ncs_patricia_tree_getnext(&cb->compdb, (uint8_t *)&comp->name)) {
> -                       if (comp->clc_info.cmd_exec_ctxt == 
> clc_evt->exec_ctxt)
> -                               break;
> -                       if (comp->clc_info.am_cmd_exec_ctxt == 
> clc_evt->exec_ctxt) {
> -                               amcmd = 1;
> -                               break;
> -                       }
> -               }
> -       } else
> -               /* => cmd did not launch successfully (comp is available) */
> -               comp = m_AVND_COMPDB_REC_GET(cb->compdb, clc_evt->comp_name);
> +       comp = m_AVND_COMPDB_REC_GET(cb->compdb, clc_evt->comp_name);
>
>         /* either other cmd is currently executing or the comp is deleted */
> -       if (!comp)
> -               goto done;
> +       if (comp == NULL) {
> +                LOG_WA("%s: could not find comp '%s'", __FUNCTION__,
> +                                clc_evt->comp_name.value);
> +                goto done;
> +       }
>
>         TRACE("'%s'", comp->name.value);
>
> -       if (amcmd || clc_evt->cmd_type == AVND_COMP_CLC_CMD_TYPE_AMSTART ||
> +       if (clc_evt->cmd_type == AVND_COMP_CLC_CMD_TYPE_AMSTART ||
>             clc_evt->cmd_type == AVND_COMP_CLC_CMD_TYPE_AMSTOP) {
>                 TRACE("CLC command 
> type:'%s'",clc_cmd_type[clc_evt->cmd_type]);
>                 switch (comp->clc_info.am_exec_cmd) {
> @@ -431,7 +417,7 @@ uint32_t avnd_evt_clc_resp_evh(AVND_CB *
>                         break;
>
>                 default:
> -                       osafassert(0);
> +                       goto done;

Why this change? It will silently discard the event.
This is a typical case of assert (not osafassert) isn't it?
/Hans

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

Reply via email to