Hi Neel

In handling of admin state of node groups there is a similar loop that from the 
beginning was a copy of the loop in SmfUtils. I have changed this loop to 
remove the incorrect 2 sec sleep and also fixed the unpredictable timeout time 
for the loop. I was thinking that the loop in SmfUtils should be fixed in the 
same way and also make it possible to use the SmfUtil admin operation handling 
with node groups as well. What do you think about this?

Thanks
Lennart

> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> Sent: den 30 november 2016 08:53
> To: Lennart Lund <[email protected]>; Rafael Odzakow
> <[email protected]>; Tai Chi Dinh <[email protected]>
> Cc: [email protected]
> Subject: [PATCH 1 of 1] smf: Avoid uncditional sleep when calling
> adminoperation[#2211]
> 
>  osaf/services/saf/smfsv/smfd/SmfUtils.cc |  26 +++++++++++++++-----------
>  1 files changed, 15 insertions(+), 11 deletions(-)
> 
> 
> diff --git a/osaf/services/saf/smfsv/smfd/SmfUtils.cc
> b/osaf/services/saf/smfsv/smfd/SmfUtils.cc
> --- a/osaf/services/saf/smfsv/smfd/SmfUtils.cc
> +++ b/osaf/services/saf/smfsv/smfd/SmfUtils.cc
> @@ -583,19 +583,23 @@ SmfImmUtils::callAdminOperation(const st
>       }
> 
>       /* Call the admin operation */
> -     do {
> -             TRACE("call immutil_saImmOmAdminOperationInvoke_2");
> +
> +     TRACE("call immutil_saImmOmAdminOperationInvoke_2");
> +     rc = immutil_saImmOmAdminOperationInvoke_2(m_ownerHandle,
> &objectName, 0, i_operationId, i_params,
> +                     &returnValue, i_timeout);
> +     while ((rc == SA_AIS_OK) && (returnValue ==
> SA_AIS_ERR_TRY_AGAIN)){
> +             sleep(2);
>               rc =
> immutil_saImmOmAdminOperationInvoke_2(m_ownerHandle,
> &objectName, 0, i_operationId, i_params,
> -                                                        &returnValue,
> i_timeout);
> -             if (retry <= 0) {
> -                     LOG_NO("Fail to invoke admin operation, too many
> SA_AIS_ERR_TRY_AGAIN, giving up. dn=[%s], opId=[%u]",
> -                            i_dn.c_str(), i_operationId);
> -                     rc = SA_AIS_ERR_TRY_AGAIN;
> -                     goto done;
> -             }
> -             sleep(2);
> +                             &returnValue, i_timeout);
>               retry--;
> -     } while ((rc == SA_AIS_OK) && (returnValue ==
> SA_AIS_ERR_TRY_AGAIN));
> +     }
> +
> +     if (retry <= 0) {
> +             LOG_NO("Fail to invoke admin operation, too many
> SA_AIS_ERR_TRY_AGAIN, giving up. dn=[%s], opId=[%u]",
> +                             i_dn.c_str(), i_operationId);
> +             rc = SA_AIS_ERR_TRY_AGAIN;
> +             goto done;
> +     }
> 
>       if ( rc != SA_AIS_OK) {
>               LOG_NO("Fail to invoke admin operation, rc=%s. dn=[%s],
> opId=[%u]",saf_error(rc), i_dn.c_str(), i_operationId);

------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to