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
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.
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.clktrk
> _______________________________________________
> 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