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 | 61 ++++++++++++++++++++++++---------------
1 file changed, 37 insertions(+), 24 deletions(-)
diff --git a/src/smf/smfd/SmfCampaignWrapup.cc
b/src/smf/smfd/SmfCampaignWrapup.cc
index 199ee19..10bdbf0 100644
--- a/src/smf/smfd/SmfCampaignWrapup.cc
+++ b/src/smf/smfd/SmfCampaignWrapup.cc
@@ -228,39 +228,52 @@ bool SmfCampaignWrapup::executeCampComplete() {
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));
+ 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) {
+ base::Timer adminOpTimer(60000);
+ while (adminOpTimer.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 (adminOpTimer.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