Hi Lennart,
Reviewed the patch, I have to NACK the patch because of the comments.
Following are the comments:
1. The retries can not be infinite, while(1) has to be changed to some
finite number of retries.
2. make saImmOiFinalize as part of getAllImmHandles. (for more
information look into avd_imm_reinit_bg_thread in
osaf/services/saf/amf/amfd/imm.cc)
3. for each retry there must be sleep.
Regards,
Neel.
On 2016/09/22 07:03 PM, Lennart Lund wrote:
> osaf/services/saf/smfsv/smfd/SmfUpgradeStep.cc | 49
> +++++++++++++++++--------
> 1 files changed, 33 insertions(+), 16 deletions(-)
>
>
> Fix the deleteNodeGroup() method must be so that if the delete operation fails
> with bad handles new handles are created so that the node group can be deleted
>
> diff --git a/osaf/services/saf/smfsv/smfd/SmfUpgradeStep.cc
> b/osaf/services/saf/smfsv/smfd/SmfUpgradeStep.cc
> --- a/osaf/services/saf/smfsv/smfd/SmfUpgradeStep.cc
> +++ b/osaf/services/saf/smfsv/smfd/SmfUpgradeStep.cc
> @@ -3580,22 +3580,36 @@ bool SmfAdminOperation::deleteNodeGroup(
> &nodeGroupName);
>
> TRACE("\t Deleting nodeGroup '%s'", nodeGroupName_s.c_str());
> -
> - m_errno = immutil_saImmOmCcbObjectDelete(m_ccbHandle,
> - &nodeGroupName);
> - if (m_errno != SA_AIS_OK) {
> - LOG_NO("%s: saImmOmCcbObjectDelete '%s' Fail %s",
> - __FUNCTION__, nodeGroupName_s.c_str(),
> - saf_error(m_errno));
> - rc = false;
> - } else {
> - m_errno = saImmOmCcbApply(m_ccbHandle);
> - if (m_errno != SA_AIS_OK) {
> - LOG_NO("%s: saImmOmCcbApply() Fail '%s'",
> - __FUNCTION__, saf_error(m_errno));
> - rc = false;
> - }
> - }
> + while (true) {
> + m_errno = immutil_saImmOmCcbObjectDelete(m_ccbHandle,
> + &nodeGroupName);
> + if (m_errno == SA_AIS_ERR_BAD_HANDLE) {
> + // Handles may have been invalidated/timed out
> + (void)immutil_saImmOmFinalize(m_omHandle);
> + bool rc = getAllImmHandles();
> + if (rc == false) {
> + LOG_NO("%s: getAllImmHandles Fail",
> + __FUNCTION__);
> + break;
> + }
> + continue;
> + }
> + if (m_errno != SA_AIS_OK) {
> + LOG_NO("%s: saImmOmCcbObjectDelete '%s' Fail %s",
> + __FUNCTION__, nodeGroupName_s.c_str(),
> + saf_error(m_errno));
> + rc = false;
> + break;
> + } else {
> + m_errno = saImmOmCcbApply(m_ccbHandle);
> + if (m_errno != SA_AIS_OK) {
> + LOG_NO("%s: saImmOmCcbApply() Fail '%s'",
> + __FUNCTION__, saf_error(m_errno));
> + rc = false;
> + }
> + break;
> + }
> + }
>
> TRACE_LEAVE();
> return rc;
> @@ -3633,6 +3647,9 @@ bool SmfAdminOperation::nodeGroupAdminOp
> &nodeGroupName, 0, adminOp, params,
> &oi_rc, smfd_cb->adminOpTimeout);
>
> + if (m_errno == SA_AIS_OK && oi_rc == SA_AIS_OK)
> + break;
> +
> if (retry <= 0) {
> LOG_NO("Fail to invoke admin operation, too many OI "
> "TRY_AGAIN, giving up. %s", __FUNCTION__);
------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel