Hi Neel,

Ack with comment

If you copied the loop used with admin operation for node group also this loop 
would get a more predictable timeout. But even if you do that #2212 is still 
needed in order to get rid of code redundancy.

Thanks
Lennart 

> -----Original Message-----
> From: Neelakanta Reddy [mailto:reddy.neelaka...@oracle.com]
> Sent: den 1 december 2016 06:14
> To: Tai Chi Dinh <tai.d...@dektech.com.au>; Lennart Lund
> <lennart.l...@ericsson.com>; Rafael Odzakow
> <rafael.odza...@ericsson.com>
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 1 of 1] smf: Avoid unconditional sleep when calling
> adminoperation[#2211] V1
> 
> Hi ,
> 
> will be pushing the patch if there are no further comments.
> #2212 is opened to change SmfImmUtils AdminOperation the same way as
> Node group admin operation.
> 
> Thanks,
> Neel.
> 
> On 2016/11/30 02:42 PM, Tai Dinh wrote:
> > Thank Neel,
> >
> > ACK from me.
> >
> > /Tai
> > -----Original Message-----
> > From: reddy.neelaka...@oracle.com
> [mailto:reddy.neelaka...@oracle.com]
> > Sent: Wednesday, November 30, 2016 3:47 PM
> > To: lennart.l...@ericsson.com; rafael.odza...@ericsson.com;
> > tai.d...@dektech.com.au
> > Cc: opensaf-devel@lists.sourceforge.net
> > Subject: [PATCH 1 of 1] smf: Avoid unconditional sleep when calling
> > adminoperation[#2211] V1
> >
> >   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) &&
> > (retry > 0) ){
> > +           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
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to