Hi Anders,

I just clarified in another mail thread and ticket #521 also. The socpe of this 
patch/ticket is to fix the problem created by the sleep when the 
terminatecallback gets hit in the admin-restart of the ND component!
Thanks for your comments, please find my responses inline:

> 
> Ack from me, with comments:
> 
> * Shouldn't immnd also do kill(immnd_cb->loaderPid, SIGTERM); ?
> 
> The cleanup script does:
>      /usr/bin/killall osafimmpbed
>      /usr/bin/killall osafimmloadd

The IMM being a special case among the Node Directors i.e it is the only Node 
Director started by NID(pre-AMF) and the patch, apart  from removing the sleep, 
also mimicks the current behavior of IMM clc-cli scripts.
In this background, the patch for IMM also requires the following change

diff --git a/osaf/services/saf/immsv/immnd/scripts/osaf-immnd.in 
b/osaf/services/saf/immsv/immnd/scripts/osaf-immnd.in
--- a/osaf/services/saf/immsv/immnd/scripts/osaf-immnd.in
+++ b/osaf/services/saf/immsv/immnd/scripts/osaf-immnd.in
@@ -62,6 +62,7 @@ instantiate() {
        echo $SA_AMF_COMPONENT_NAME > $COMPNAMEFILE
        if [ -e $lockfile ]; then
                killproc -p $pidfile $binary -USR1
+               rm -f $lockfile
        else
                start_daemon -p $pidfile $binary $args
        fi

w.r.t to your comment about killing immload, Neelakanta has observed that 
perhaps killing immload and immsync would not be necessary at all. 
I'm waiting for this review comment shortly.

> 
> We are trying to do basically the same as the cleanup script, so kill all the
> processes. Another thing is that SIGTERM is not guaranteed to really make
> the process go away, but I guess that is a separate issue.
> 
> * I think there is still a race in the terminate callbacks. Removing the sleep
> only makes the problem less likely to occur, but the process doesn't
> disappear immediately just because the sleep is removed. So theoretically
> the problem is still there. I guess in order to properly solve it, AMF needs
> some logic to check that the old process really has disappeared before trying
> to re-instantiate the component.


It is possible, but it would still be the component's responsibility to exit 
cleanly!
Again, this patch should only be considered as a first step to improve the 
adm-restart support/behavior and
We could use ticket #521 for tracking this.

Thanks,
Mathi.

> 
> regards,
> Anders Widell
> 
> 2013-07-22 14:03, [email protected] skrev:
> >   osaf/services/saf/cpsv/cpnd/cpnd_amf.c    |   5 +++--
> >   osaf/services/saf/glsv/glnd/glnd_amf.c    |   6 +++---
> >   osaf/services/saf/immsv/immnd/immnd_amf.c |  12 +++++++++---
> >   osaf/services/saf/mqsv/mqnd/mqnd_amf.c    |   5 ++---
> >   osaf/services/saf/smfsv/smfnd/smfnd_amf.c |   6 +++---
> >   5 files changed, 20 insertions(+), 14 deletions(-)
> >
> >
> > diff --git a/osaf/services/saf/cpsv/cpnd/cpnd_amf.c
> > b/osaf/services/saf/cpsv/cpnd/cpnd_amf.c
> > --- a/osaf/services/saf/cpsv/cpnd/cpnd_amf.c
> > +++ b/osaf/services/saf/cpsv/cpnd/cpnd_amf.c
> > @@ -241,9 +241,10 @@ void cpnd_amf_comp_terminate_callback(Sa
> >     }
> >     saAmfResponse(cb->amf_hdl, invocation, saErr);
> >     ncshm_give_hdl(gl_cpnd_cb_hdl);
> > -   sleep(1);
> >     LOG_NO("Received AMF component terminate callback, exiting");
> > -   exit(0);
> > +   TRACE_LEAVE();
> > +
> > +   _Exit(EXIT_SUCCESS);
> >   }
> >
> >
> >
> /**********************************************************
> ***********
> > ******* diff --git a/osaf/services/saf/glsv/glnd/glnd_amf.c
> > b/osaf/services/saf/glsv/glnd/glnd_amf.c
> > --- a/osaf/services/saf/glsv/glnd/glnd_amf.c
> > +++ b/osaf/services/saf/glsv/glnd/glnd_amf.c
> > @@ -125,10 +125,10 @@ void glnd_amf_comp_terminate_callback(Sa
> >             /* giveup the handle */
> >             m_GLND_GIVEUP_GLND_CB;
> >     }
> > +   LOG_NO("Received AMF component terminate callback, exiting");
> >     TRACE_LEAVE();
> > -   sleep(1);
> > -   LOG_NO("Received AMF component terminate callback, exiting");
> > -   exit(0);
> > +
> > +   _Exit(EXIT_SUCCESS);
> >   }
> >
> >
> >
> /**********************************************************
> ***********
> > ******* diff --git a/osaf/services/saf/immsv/immnd/immnd_amf.c
> > b/osaf/services/saf/immsv/immnd/immnd_amf.c
> > --- a/osaf/services/saf/immsv/immnd/immnd_amf.c
> > +++ b/osaf/services/saf/immsv/immnd/immnd_amf.c
> > @@ -73,10 +73,16 @@ static void immnd_amf_comp_terminate_cal
> >   {
> >     TRACE_ENTER();
> >     saAmfResponse(immnd_cb->amf_hdl, invocation, SA_AIS_OK);
> > -   sleep(1);
> > +
> > +   if (immnd_cb->pbePid > 0)
> > +           kill(immnd_cb->pbePid, SIGTERM);
> > +   if (immnd_cb->syncPid > 0)
> > +           kill(immnd_cb->syncPid, SIGTERM);
> > +
> > +   LOG_NO("Received AMF component terminate callback, exiting");
> >     TRACE_LEAVE();
> > -   LOG_NO("Received AMF component terminate callback, exiting");
> > -   exit(0);
> > +
> > +   _Exit(EXIT_SUCCESS);
> >   }
> >
> >
> >
> /**********************************************************
> ***********
> > ******* diff --git a/osaf/services/saf/mqsv/mqnd/mqnd_amf.c
> > b/osaf/services/saf/mqsv/mqnd/mqnd_amf.c
> > --- a/osaf/services/saf/mqsv/mqnd/mqnd_amf.c
> > +++ b/osaf/services/saf/mqsv/mqnd/mqnd_amf.c
> > @@ -241,11 +241,10 @@ static void mqnd_amf_comp_terminate_call
> >
> >     /* giveup the handle */
> >     ncshm_give_hdl(cb_hdl);
> > +   LOG_NO("Received AMF component terminate callback, exiting");
> >     TRACE_LEAVE();
> > -   LOG_NO("Received AMF component terminate callback, exiting");
> > -   sleep(1);
> > -   exit(0);
> >
> > +   _Exit(EXIT_SUCCESS);
> >   }
> >
> >   static void mqnd_amf_CSI_set_callback(SaInvocationT invocation, diff
> > --git a/osaf/services/saf/smfsv/smfnd/smfnd_amf.c
> > b/osaf/services/saf/smfsv/smfnd/smfnd_amf.c
> > --- a/osaf/services/saf/smfsv/smfnd/smfnd_amf.c
> > +++ b/osaf/services/saf/smfsv/smfnd/smfnd_amf.c
> > @@ -110,10 +110,10 @@ static void amf_comp_terminate_callback(
> >
> >     saAmfResponse(smfnd_cb->amf_hdl, invocation, SA_AIS_OK);
> >
> > +   LOG_NO("Received AMF component terminate callback, exiting");
> >     TRACE_LEAVE();
> > -   sleep(1);
> > -   LOG_NO("Received AMF component terminate callback, exiting");
> > -   exit(0);
> > +
> > +   _Exit(EXIT_SUCCESS);
> >   }
> >
> >
> >
> /**********************************************************
> ***********
> > *******
> >
> > ----------------------------------------------------------------------
> > -------- See everything from the browser to the database with
> > AppDynamics Get end-to-end visibility with application monitoring from
> > AppDynamics Isolate bottlenecks and diagnose root cause in seconds.
> > Start your free trial of AppDynamics Pro today!
> > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.c
> > lktrk _______________________________________________
> > Opensaf-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/opensaf-devel
> >
> >
> 

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to