SmfCampaignWrapup::executeCampComplete()  is calling SmfImmCcbAction. So looks like a double retry spread out across two classes. Why not have the retries in  SmfImmCcbAction::execute only?


On 11/17/2017 07:12 AM, Vijay Roy wrote:

Hi Rafael,

We need the while loop in “SmfCampaignWrapup::executeCampComplete()” as we encountered the issue at Wrapup too while testing.

Thanks

Vijay

-----Original Message-----
From: Rafael Odzakow [mailto:rafael.odza...@ericsson.com]
Sent: Thursday, November 16, 2017 8:54 PM
To: Vijay Roy <vijay....@oracle.com>
Cc: opensaf-devel@lists.sourceforge.net; Lennart Lund <lennart.l...@ericsson.com> Subject: Re: [PATCH 1/1] smf: SMF created a CCB to create smfRollbackElement object, but CCB was aborted due to IMM [#2676]

What about the added while loops in

SmfCampaignWrapup::executeCampComplete() should they be removed now with this addition?

On 11/16/2017 10:44 AM, Vijay Roy wrote:

> Handling ERROR_EXIST in smfRollbackElement creation and handling

> TRY_AGAIN in immCCBOperations.

> ---

>   src/smf/smfd/SmfUpgradeAction.cc | 26 +++++++++++++++++++-------

>   1 file changed, 19 insertions(+), 7 deletions(-)

>

> diff --git a/src/smf/smfd/SmfUpgradeAction.cc

> b/src/smf/smfd/SmfUpgradeAction.cc

> index 94c3dfd..af75cd7 100644

> --- a/src/smf/smfd/SmfUpgradeAction.cc

> +++ b/src/smf/smfd/SmfUpgradeAction.cc

> @@ -28,6 +28,7 @@

>   #include "smf/smfd/SmfUtils.h"

>   #include "smfd.h"

>   #include "smf/smfd/SmfTargetTemplate.h"

> +#include "base/time.h"

>

>   /* ========================================================================

>    *   DEFINITIONS

> @@ -460,6 +461,7 @@ SaAisErrorT SmfImmCcbAction::execute(SaImmOiHandleT i_oiHandle,

> const std::string* i_rollbackDn) {

>     SaAisErrorT result = SA_AIS_OK;

>     SmfRollbackCcb* rollbackCcb = NULL;

> +  base::Timer doImmOpTimer(60000);

>

>     TRACE_ENTER();

>

> @@ -473,8 +475,8 @@ SaAisErrorT SmfImmCcbAction::execute(SaImmOiHandleT i_oiHandle,

>       immRollbackCcbDn += ",";

>       immRollbackCcbDn += *i_rollbackDn;

>

> -    if ((result = smfCreateRollbackElement(immRollbackCcbDn, i_oiHandle)) !=

> -        SA_AIS_OK) {

> +    result = smfCreateRollbackElement(immRollbackCcbDn, i_oiHandle);

> +    if ((result != SA_AIS_OK) && (result != SA_AIS_ERR_EXIST)) {

>         LOG_ER(

> "SmfImmCcbAction::execute failed to create rollback element %s, rc=%s",

> immRollbackCcbDn.c_str(), saf_error(result)); @@ -490,11

> +492,21 @@ SaAisErrorT SmfImmCcbAction::execute(SaImmOiHandleT i_oiHandle,

>     }

>

>     if (m_operations.size() > 0) {

> -    SmfImmUtils immUtil;

> -    if ((result = immUtil.doImmOperations(m_operations, rollbackCcb)) !=

> -        SA_AIS_OK) {

> -      delete rollbackCcb;

> -      rollbackCcb = NULL;

> +

> + doImmOpTimer.set_timeout_time(60000);

> +    while (doImmOpTimer.is_timeout() == false) {

> +      SmfImmUtils immUtil;

> +      result = immUtil.doImmOperations(m_operations, rollbackCcb);

> +      if (result == SA_AIS_ERR_TRY_AGAIN) {

> + base::Sleep(base::kFiveHundredMilliseconds);

> +         continue;

> +      } else if (result != SA_AIS_OK) {

> +         LOG_WA("%s: SmfImmCcbAction:execute Fail '%s'",

> +                 __FUNCTION__, saf_error(result));

> +         delete rollbackCcb;

> +         rollbackCcb = NULL;

> +      }

> +      break;

>       }

>     }

>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to