Ack, code review only.

Thanks,
Praveen

On 17-Nov-16 1:56 PM, [email protected] wrote:
>  osaf/services/saf/amf/amfnd/clc.cc  |  38 
> +++++++++++++++++++++++++++++-------
>  osaf/services/saf/amf/amfnd/susm.cc |  24 ++++++++++++++++++++++-
>  2 files changed, 53 insertions(+), 9 deletions(-)
>
>
> When proxy and proxied are in the same SU and if proxy
> fails and SU restart is escalated, then proxied are not being
> cleaned up.
> Added cleanup commands for proxied component if their proxy are not
> in healthy state.
> Also, during opensafd stop, opensafd is not able to terminate the proxy.
> Added fix for this also.
>
> diff --git a/osaf/services/saf/amf/amfnd/clc.cc 
> b/osaf/services/saf/amf/amfnd/clc.cc
> --- a/osaf/services/saf/amf/amfnd/clc.cc
> +++ b/osaf/services/saf/amf/amfnd/clc.cc
> @@ -2020,26 +2020,48 @@ uint32_t avnd_comp_clc_inst_clean_hdler(
>
>       if (m_AVND_COMP_TYPE_IS_PROXIED(comp)) {
>               avnd_comp_cbq_del(cb, comp, true);
> -             /* call the cleanup callback */
> -             rc = avnd_comp_cbk_send(cb, comp, AVSV_AMF_PXIED_COMP_CLEAN, 0, 
> 0);
> +             /* Check whether
> +                1. it is a case of SU restart escalation.
> +                2. it is a case of proxy-proxied residing in the same SU.
> +                3. the proxy of this component is in good state to accept 
> the callback.*/
> +
> +             /* Check if the proxy and proxied components are in the same 
> SUs. */
> +             if ((m_AVND_SU_IS_RESTART(comp->su) && 
> m_AVND_SU_IS_FAILED(comp->su)) && /* #1. */
> +                             ((comp->pxy_comp) && (comp->su == 
> comp->pxy_comp->su)) && /* #2  */
> +                             (m_AVND_COMP_IS_FAILED(comp->pxy_comp))) { /* 
> #3 */
> +                     /* If proxy is not in good shape, we can't issue 
> callback, so issue cleanup
> +                        (assume it is local component). */
> +                     rc = avnd_comp_clc_cmd_execute(cb, comp, 
> AVND_COMP_CLC_CMD_TYPE_CLEANUP);
> +             } else {
> +                     /* call the cleanup callback */
> +                     rc = avnd_comp_cbk_send(cb, comp, 
> AVSV_AMF_PXIED_COMP_CLEAN, 0, 0);
> +             }
>       } else if (m_AVND_COMP_TYPE_IS_PROXY(comp) && comp->pxied_list.n_nodes) 
> {
>               /* if there are still outstanding proxied components we can't 
> terminate right now */
>               /* Check if the proxy and proxied components are in the same 
> SUs. */
>               TRACE("Proxy has proxied components: %u", 
> comp->pxied_list.n_nodes);
>               AVND_COMP_PXIED_REC *rec;
>               rec = (AVND_COMP_PXIED_REC 
> *)m_NCS_DBLIST_FIND_FIRST(&comp->pxied_list);
> -                while (rec) {
> -                        if (comp->su == rec->pxied_comp->su)
> +             while (rec) {
> +                     if (comp->su == rec->pxied_comp->su)
>                               break;
> -                        rec = (AVND_COMP_PXIED_REC 
> *)m_NCS_DBLIST_FIND_NEXT(&rec->comp_dll_node);
> -                }
> +                     rec = (AVND_COMP_PXIED_REC 
> *)m_NCS_DBLIST_FIND_NEXT(&rec->comp_dll_node);
> +             }
>               if (rec == nullptr) {
>                       TRACE("Proxy and proxied are not in the same SU.");
>                       /* This means that proxy and proxied components are not 
> in the same SU.
>                          That means that we can cleanup the component. */
>                       rc = avnd_comp_clc_cmd_execute(cb, comp, 
> AVND_COMP_CLC_CMD_TYPE_CLEANUP);
> -             } else
> -                     return rc;
> +             } else {
> +                     TRACE("Proxy and proxied are in the same SU.");
> +                     if (((m_AVND_SU_IS_RESTART(comp->su) && 
> m_AVND_SU_IS_FAILED(comp->su)) &&
> +                                             (m_AVND_COMP_IS_FAILED(comp))) 
> ||
> +                                     (cb->term_state == 
> AVND_TERM_STATE_OPENSAF_SHUTDOWN_STARTED)) {
> +                             /* If proxy is not in good shape, so issue 
> cleanup. */
> +                             rc = avnd_comp_clc_cmd_execute(cb, comp, 
> AVND_COMP_CLC_CMD_TYPE_CLEANUP);
> +                     } else
> +                             goto done;
> +             }
>       } else {
>               if (m_AVND_SU_IS_RESTART(comp->su) && 
> m_AVND_COMP_IS_RESTART_DIS(comp) &&
>                               (comp->csi_list.n_nodes > 0) &&
> diff --git a/osaf/services/saf/amf/amfnd/susm.cc 
> b/osaf/services/saf/amf/amfnd/susm.cc
> --- a/osaf/services/saf/amf/amfnd/susm.cc
> +++ b/osaf/services/saf/amf/amfnd/susm.cc
> @@ -2601,8 +2601,30 @@ uint32_t avnd_su_pres_inst_comprestart_h
>                               if (NCSCC_RC_SUCCESS != rc)
>                                       goto done;
>                               break;
> +                     } else {
> +                             /*
> +                                For a NPI comp in SU, component FSM is 
> always triggered
> +                                at the time of assignments. If this 
> component is
> +                                non-restartable then start reassginment from 
> the
> +                                whole SU now.
> +                              */
> +                             if (m_AVND_COMP_IS_RESTART_DIS(curr_comp) &&
> +                                             (curr_comp->csi_list.n_nodes > 
> 0)) {
> +                                     TRACE("Start reassignment to different 
> SU as '%s' is"
> +                                                     " not restartable", 
> curr_comp->name.c_str());
> +                                     su_send_suRestart_recovery_msg(su);
> +                                     goto done;
> +                             } else {
> +                                     if (m_AVND_SU_IS_RESTART(su) && 
> m_AVND_SU_IS_FAILED(su))
> +                                             rc = avnd_comp_clc_fsm_run(cb, 
> curr_comp, AVND_COMP_CLC_PRES_FSM_EV_CLEANUP);
> +                                     else
> +                                             rc = avnd_comp_clc_fsm_run(cb, 
> curr_comp, AVND_COMP_CLC_PRES_FSM_EV_RESTART);
> +                                     if (curr_comp->pres == 
> SA_AMF_PRESENCE_TERMINATING)
> +                                             avnd_su_pres_state_set(cb, su, 
> SA_AMF_PRESENCE_TERMINATING);
> +                                     break;
> +                             }
>                       }
> -             }
> +             }
>               if (su_evaluate_restarting_state(su) == true)
>                       avnd_su_pres_state_set(cb, su, 
> SA_AMF_PRESENCE_RESTARTING);
>       }
>

------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to