Hi Tai, Yes, you are correct. will add "retry > 0" and re-publish the patch.
Thanks, Neel. On 2016/11/30 01:43 PM, Tai Dinh wrote: > Hi Neel, > > NACK with the patch. > Need to add 'retry > 0' as part of while loop condition. > > /Tai > -----Original Message----- > From: [email protected] [mailto:[email protected]] > Sent: Wednesday, November 30, 2016 2:53 PM > To: [email protected]; [email protected]; > [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
