please find some comments.
Thanks,
Praveen
On 06-May-16 12:16 PM, Gary Lee wrote:
> osaf/services/saf/amf/amfd/main.cc | 37
> ++++++++++++++++++++++++++++++-------
> 1 files changed, 30 insertions(+), 7 deletions(-)
>
>
> amfd needs to reinit with CLM if saClmDispatch() returns SA_AIS_ERR_BAD_HANDLE
>
> diff --git a/osaf/services/saf/amf/amfd/main.cc
> b/osaf/services/saf/amf/amfd/main.cc
> --- a/osaf/services/saf/amf/amfd/main.cc
> +++ b/osaf/services/saf/amf/amfd/main.cc
> @@ -701,15 +701,38 @@ static void main_loop(void)
> if (fds[FD_CLM].revents & POLLIN) {
> TRACE("CLM event rec");
> error = saClmDispatch(cb->clmHandle, SA_DISPATCH_ONE);
> + switch (error) {
> + case SA_AIS_OK:
> + /* commit async updated possibly sent
> in the callback */
> + m_AVSV_SEND_CKPT_UPDT_SYNC(cb,
> NCS_MBCSV_ACT_UPDATE, 0);
>
> - if (error != SA_AIS_OK)
> - LOG_ER("main: saClmDispatch FAILED %u", error);
> + /* flush messages possibly queued in
> the callback */
> + avd_d2n_msg_dequeue(cb);
> + break;
> +
> + case SA_AIS_ERR_BAD_HANDLE:
> + if (avd_clm_init() != SA_AIS_OK) {
In the fix of ticekt #1781, it has been suggested for spare controllers
to init with CLM before become AMF role aware. Here also same problem
will come. If spare is running on CLM locked node then it will never
come out of avd_clm_init() as ERR_UNAVAILBLE is handled there for
reinit. Also admin will not be able to unlock it until one of the
controller joins. In this particular case AMFD must exit instead of
indefinitely calling the CLM init API.
Also this fix will cause re-init will CLM in non-headless case also. I
think in non-headless case it will be good to initialize with CLM in a
separate thread.
> + LOG_EM("avd_clm_init FAILED");
> + osafassert(false);
> + }
>
> - /* commit async updated possibly sent in the callback */
> - m_AVSV_SEND_CKPT_UPDT_SYNC(cb, NCS_MBCSV_ACT_UPDATE, 0);
> -
> - /* flush messages possibly queued in the callback */
> - avd_d2n_msg_dequeue(cb);
> + // restart CLM tracking if we are active
> + SaAmfHAStateT role;
> + if (rda_get_role(&role) !=
> NCSCC_RC_SUCCESS) {
> + LOG_ER("rda_get_role FAILED");
> + osafassert(false);
> + }
> + if (role == SA_AMF_HA_ACTIVE) {
> + if (avd_clm_track_start() !=
> SA_AIS_OK) {
> +
> LOG_ER("avd_clm_track_start FAILED");
> + osafassert(false);
> + }
> + }
> + break;
> + default:
> + LOG_ER("main: saClmDispatch FAILED %u",
> error);
> + osafassert(false);
> + }
> }
>
> if (cb->immOiHandle && fds[FD_IMM].revents & POLLIN) {
>
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel