Hi Vijay

Ack

Thanks
Lennart

> -----Original Message-----
> From: Vijay Roy [mailto:[email protected]]
> Sent: den 11 oktober 2017 08:09
> To: Lennart Lund <[email protected]>
> Cc: [email protected]; Vijay Roy <[email protected]>
> Subject: [PATCH 1/1] smf: Upgrade failed due to CCB aborted by imm sync
> request [#2584]
> 
> The Patch provides the fix where smfCreateRollbackElement return OK to
> avoid failed/ERR_EXIST situation.
> Also fixed the logging of messages correctly.
> 
> * This issue is a by-product of the fix/patch provided at commit
> 44d113c4fa669065afe78d70bc81c5297d79ec0e.
> ---
>  src/smf/smfd/SmfCampaignWrapup.cc | 67 +++++++++++++++++++++++---
> -------------
>  1 file changed, 40 insertions(+), 27 deletions(-)
> 
> diff --git a/src/smf/smfd/SmfCampaignWrapup.cc
> b/src/smf/smfd/SmfCampaignWrapup.cc
> index 199ee19..934f2f2 100644
> --- a/src/smf/smfd/SmfCampaignWrapup.cc
> +++ b/src/smf/smfd/SmfCampaignWrapup.cc
> @@ -214,53 +214,66 @@ bool
> SmfCampaignWrapup::executeCampComplete() {
>    // Campaign wrapup complete actions
>    LOG_NO("CAMP: Start campaign complete actions (%zu)",
>           m_campCompleteAction.size());
> -  base::Timer adminOpTimer(60000);
> +  base::Timer doImmOpTimer(60000);
>    SaAisErrorT ais_rc = SA_AIS_OK;
>    bool rc = true;
>    std::string completeRollbackDn;
>    completeRollbackDn = "smfRollbackElement=CampComplete,";
>    completeRollbackDn += SmfCampaignThread::instance()->campaign()-
> >getDn();
> 
> -  while (adminOpTimer.is_timeout() == false) {
> +  while (doImmOpTimer.is_timeout() == false) {
>       ais_rc = smfCreateRollbackElement(completeRollbackDn,
>                SmfCampaignThread::instance()->getImmHandle());
>       if (ais_rc == SA_AIS_ERR_TRY_AGAIN) {
>          base::Sleep(base::kFiveHundredMilliseconds);
>          continue;
>       } else if (ais_rc != SA_AIS_OK) {
> -        LOG_WA("%s: SmfCampaignWrapup::executeCampComplete Fail '%s'",
> __FUNCTION__,
> -             saf_error(ais_rc));
> +        LOG_WA("%s: SmfCampaignWrapup::executeCampComplete Fail '%s'",
> +              __FUNCTION__, saf_error(ais_rc));
>          rc = false;
> -        break;
>       }
> +     break;
>    }
> -  if (adminOpTimer.is_timeout() == true && ais_rc != SA_AIS_OK) {
> -    LOG_WA("%s: SmfCampaignWrapup::executeCampComplete()  timeout
> Fail '%s'", __FUNCTION__,
> -           saf_error(ais_rc));
> +
> +  if (doImmOpTimer.is_timeout() == true && ais_rc != SA_AIS_OK) {
> +     LOG_WA("%s: SmfCampaignWrapup::executeCampComplete()  timeout
> Fail '%s'",
> +        __FUNCTION__, saf_error(ais_rc));
> +     rc = false;
>    }
> 
> -  for (auto& elem : m_campCompleteAction) {
> -    base::Timer adminOpTimer(60000);
> -    while (adminOpTimer.is_timeout() == false) {
> -      ais_rc = (*elem).execute(SmfCampaignThread::instance()-
> >getImmHandle(),
> +  if (rc == true)
> +  {
> +     for (auto& elem : m_campCompleteAction) {
> +       doImmOpTimer.set_timeout_time(60000);
> +       while (doImmOpTimer.is_timeout() == false) {
> +          ais_rc = (*elem).execute(SmfCampaignThread::instance()-
> >getImmHandle(),
>                                    &completeRollbackDn);
> -      if (ais_rc == SA_AIS_ERR_TRY_AGAIN) {
> -         base::Sleep(base::kFiveHundredMilliseconds);
> -         continue;
> -      } else if (ais_rc != SA_AIS_OK) {
> -         LOG_WA("%s: SmfCampaignWrapup::executeCampComplete Fail '%s'",
> __FUNCTION__,
> -             saf_error(ais_rc));
> -         rc = false;
> -         break;
> -      }
> -    }
> -    if (adminOpTimer.is_timeout() == true && ais_rc != SA_AIS_OK) {
> -      LOG_WA("%s: SmfCampaignWrapup::executeCampComplete():
> m_campCompleteAction timeout Fail '%s'"
> -                   , __FUNCTION__, saf_error(ais_rc));
> -    }
> +          if (ais_rc == SA_AIS_ERR_TRY_AGAIN) {
> +             base::Sleep(base::kFiveHundredMilliseconds);
> +             continue;
> +               } else if (ais_rc != SA_AIS_OK) {
> +              LOG_WA("%s: SmfCampaignWrapup::executeCampComplete Fail
> '%s'",
> +              __FUNCTION__, saf_error(ais_rc));
> +              rc = false;
> +       }
> +          break;
> +       }
> +       if (doImmOpTimer.is_timeout() == true && ais_rc != SA_AIS_OK) {
> +          LOG_WA("%s: SmfCampaignWrapup::executeCampComplete(): "
> +             " m_campCompleteAction timeout Fail '%s'",
> +               __FUNCTION__, saf_error(ais_rc));
> +          rc = false;
> +       }
> +       if (rc == false)
> +       break;
> +     }
>    }
> 
> -  LOG_NO("CAMP: Campaign complete actions completed");
> +  if (rc == true)
> +     LOG_NO("CAMP: Campaign complete actions completed");
> +  else
> +     LOG_NO("CAMP: Campaign complete actions Failed");
> +
>    TRACE_LEAVE();
> 
>    return rc;
> --
> 1.9.1


------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to