There is one more case of LOCK_IN operation on Node hosting two or more 
SUs of same SG.
Will float the patch for that later.

Thanks
Praveen
On 07-Nov-13 2:04 PM, [email protected] wrote:
>   osaf/services/saf/amf/amfd/sg.cc |  43 
> ++++++++++++++++++++++++---------------
>   1 files changed, 26 insertions(+), 17 deletions(-)
>
>
> This patch ensures that UNINSTANTIATION of SUs in the context of LOCK_IN 
> operation on SG should
> be performed in reverse order of saAmfSuRank. As of now patch does not 
> ensure, like the case of
> instantiation, that SUs of any given rank will be terminated only after the 
> SUs of lower ranks have
> moved to TERMINATED state. AMFD will request AMFNDs to perform the 
> termination of SUs by sending termination
> request in reverse order.
>
> diff --git a/osaf/services/saf/amf/amfd/sg.cc 
> b/osaf/services/saf/amf/amfd/sg.cc
> --- a/osaf/services/saf/amf/amfd/sg.cc
> +++ b/osaf/services/saf/amf/amfd/sg.cc
> @@ -941,34 +941,43 @@ static void ccb_apply_modify_hdlr(CcbUti
>   }
>   
>   /**
> + * Terminate SU in reverse order
> + * @param su
> + */
> +static uint32_t avd_sg_su_term_in_reverse(AVD_SU *su)
> +{
> +  uint32_t rc = NCSCC_RC_SUCCESS;
> +  TRACE_ENTER2("su:'%s'", su ? su->name.value : NULL);
> +  if (su->sg_list_su_next != NULL)
> +     rc = avd_sg_su_term_in_reverse(su->sg_list_su_next);
> +  if ((su->saAmfSUPreInstantiable == true) &&
> +               (su->saAmfSUPresenceState != SA_AMF_PRESENCE_UNINSTANTIATED) 
> &&
> +               (su->saAmfSUPresenceState != 
> SA_AMF_PRESENCE_INSTANTIATION_FAILED) &&
> +               (su->saAmfSUPresenceState != 
> SA_AMF_PRESENCE_TERMINATION_FAILED)) {
> +
> +       if (avd_snd_presence_msg(avd_cb, su, true) == NCSCC_RC_SUCCESS) {
> +               m_AVD_SET_SU_TERM(avd_cb, su, true);
> +       } else {
> +               rc = NCSCC_RC_FAILURE;
> +               LOG_WA("Failed Termination '%s'", su->name.value);
> +       }
> +  }
> +  return rc ;
> +}
> +/**
>    * perform lock-instantiation on a given SG
>    * @param cb
>    * @param sg
>    */
>   static uint32_t sg_app_sg_admin_lock_inst(AVD_CL_CB *cb, AVD_SG *sg)
>   {
> -     AVD_SU *su;
>       uint32_t rc = NCSCC_RC_SUCCESS;
>   
>       TRACE_ENTER2("%s", sg->name.value);
>   
>       /* terminate all the SUs on this Node */
> -     su = sg->list_of_su;
> -     while (su != NULL) {
> -             if ((su->saAmfSUPreInstantiable == true) &&
> -                     (su->saAmfSUPresenceState != 
> SA_AMF_PRESENCE_UNINSTANTIATED) &&
> -                     (su->saAmfSUPresenceState != 
> SA_AMF_PRESENCE_INSTANTIATION_FAILED) &&
> -                     (su->saAmfSUPresenceState != 
> SA_AMF_PRESENCE_TERMINATION_FAILED)) {
> -
> -                     if (avd_snd_presence_msg(cb, su, true) == 
> NCSCC_RC_SUCCESS) {
> -                             m_AVD_SET_SU_TERM(cb, su, true);
> -                     } else {
> -                             rc = NCSCC_RC_FAILURE;
> -                             LOG_WA("Failed Termination '%s'", 
> su->name.value);
> -                     }
> -             }
> -             su = su->sg_list_su_next;
> -     }
> +     if (sg->list_of_su != NULL)
> +             rc = avd_sg_su_term_in_reverse(sg->list_of_su);
>   
>       TRACE_LEAVE2("%u", rc);
>       return rc;
>
> ------------------------------------------------------------------------------
> November Webinars for C, C++, Fortran Developers
> Accelerate application performance with scalable programming models. Explore
> techniques for threading, error checking, porting, and tuning. Get the most
> from the latest Intel processors and coprocessors. See abstracts and register
> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
> _______________________________________________
> Opensaf-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensaf-devel


------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to