OK I got it, the for loop is needed. I have tested it and can
reproduce and see that the patch fix the problem.

Minor comments:
* the commit message is too long, you could shrink it to: "fix cleanup
of assigned comp in shutdown"

* see inline

Ack

Thanks,
Hans


On 4 February 2014 10:44,  <praveen.malv...@oracle.com> wrote:
>  osaf/services/saf/amf/amfnd/clc.cc |  26 ++++++++++++++++++++------
>  1 files changed, 20 insertions(+), 6 deletions(-)
>
>
> During opensaf shutdown AMFND removes the SIs from the SUs in the reverse 
> order of their ranks.                   At component level this gets 
> translated as giving csi removal callback to the components with TARGET_ONE.
> Reported problem occurs when an assigned component faults while removal is 
> going on other components.
> When AMFND gets cleanup success event, it sees it as if the component was 
> faulted while handling removal
> callback and thus it tries to move CSIs and SIs assigned to this component to 
> removed state. Since CSIs and       SIs were already in assigned state AMFND 
> asserts for assigning state check.
> This patch ensures that during shutdown phase if an assigned component faults 
> then AMFND should mark CSIs and SIs assigned if they were in assigning state.
>
> 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
> @@ -2038,12 +2038,26 @@ uint32_t avnd_comp_clc_terming_cleansucc
>                  */
>                 if (!comp->su->is_ncs && comp->csi_list.n_nodes > 0) {
>                         AVND_COMP_CSI_REC *csi;
> -                       int csis_removed = 0; // for sanity checking number 
> of loops
> -
> -                       while ((csi = 
> m_AVND_CSI_REC_FROM_COMP_DLL_NODE_GET(m_NCS_DBLIST_FIND_FIRST(&comp->csi_list)))
>  != NULL) {
> -                               m_AVND_COMP_CSI_CURR_ASSIGN_STATE_SET(csi, 
> AVND_COMP_CSI_ASSIGN_STATE_REMOVED);
> -                               rc = avnd_comp_csi_remove_done(cb, comp, csi);
> -                               osafassert(++csis_removed < 1000);
> +
> +                       for (csi = 
> m_AVND_CSI_REC_FROM_COMP_DLL_NODE_GET(m_NCS_DBLIST_FIND_FIRST(&comp->csi_list));
> +                               csi;

check csi != NULL

> +                               csi = 
> m_AVND_CSI_REC_FROM_COMP_DLL_NODE_GET(m_NCS_DBLIST_FIND_NEXT(&csi->comp_dll_node)))
>  {
> +                               /* In shutdown phase SIs are removed honoring 
> saAmfSIRank in reverse
> +                                  order. A component which is having a CSI 
> from a higher rank assigned
> +                                  SI can fault while removal of lower rank 
> SIs is going on. In such
> +                                  case CSIs of this component will be in 
> assigned state only, so remove
> +                                  done indication cannot be generated for 
> assigned CSIs.
> +                                */
> +                               if 
> (m_AVND_COMP_CSI_CURR_ASSIGN_STATE_IS_REMOVING(csi))
> +                                       rc = avnd_comp_csi_remove_done(cb, 
> comp, csi);
> +
> +                               /* Removal of last CSI from this component 
> may lead to SUSI assign/remove
> +                                  done indication, which eventually deletes 
> all COMP-CSI record.
> +                                  In such a case there will not be any CSI 
> in comp->csi_list, so come
> +                                  out of the loop.
> +                                */
> +                               if (!comp->csi_list.n_nodes)

check n_nodes == 0

> +                                       break;
>                         }
>                 }
>
>
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
> _______________________________________________
> Opensaf-devel mailing list
> Opensaf-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/opensaf-devel

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&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