osaf/services/saf/smfsv/smfd/SmfCampState.cc     |  20 ++++++++++++++------
 osaf/services/saf/smfsv/smfd/smfd_campaign_oi.cc |   3 ++-
 osaf/services/saf/smfsv/smfd/smfd_main.c         |   4 ++--
 3 files changed, 18 insertions(+), 9 deletions(-)


SMF restores PBE before campaign state is updated (before the wrapup/completed
actions)to avoid interference with background campaign actions started in the
wrapup/completed portion and admin operations directed to SMF just after 
entering
completed state.

diff --git a/osaf/services/saf/smfsv/smfd/SmfCampState.cc 
b/osaf/services/saf/smfsv/smfd/SmfCampState.cc
--- a/osaf/services/saf/smfsv/smfd/SmfCampState.cc
+++ b/osaf/services/saf/smfsv/smfd/SmfCampState.cc
@@ -830,6 +830,14 @@ SmfCampStateExecuting::executeWrapup(Smf
 {
        TRACE_ENTER();
 
+       //Activate IMM BPE if active when campaign was started.
+       i_camp->restorePbe();
+
+       // Wait for IMM to become writable again by keep on writing until it
+       // succeeds. Write the same value, just for synchronization purposes.
+       changeState(i_camp, SmfCampStateExecuting::instance());
+
+       // IMM is writeable again so let's execute campCompleteAction
        if (i_camp->m_campWrapup.executeCampComplete() == false) {
                std::string error = "Campaign wrapup executing campaign 
complete actions failed";
                LOG_ER("%s", error.c_str());
@@ -838,9 +846,6 @@ SmfCampStateExecuting::executeWrapup(Smf
                return SMF_CAMP_FAILED;
        }
 
-       //Activate IMM BPE if active when campaign was started.
-       i_camp->restorePbe();
-
        // TODO Start wait to complete timer
        LOG_NO("CAMP: Start wait to complete timer (not implemented yet)");
 
@@ -1737,6 +1742,12 @@ SmfCampRollingBack::rollbackInit(SmfUpgr
        TRACE_ENTER();
 
         TRACE("SmfCampRollingBack::rollbackInit implementation");
+        //Activate IMM BPE if active when campaign was started.
+       i_camp->restorePbe();
+
+       // Wait for IMM to become writable again by keep on writing until it
+       // succeeds. Write the same value, just for synchronization purposes.
+       changeState(i_camp, SmfCampRollingBack::instance());
 
         if (i_camp->m_campInit.rollback() != SA_AIS_OK) {
                std::string error = "Campaign init rollback failed";
@@ -1745,9 +1756,6 @@ SmfCampRollingBack::rollbackInit(SmfUpgr
                changeState(i_camp, SmfCampRollbackFailed::instance());
                return SMF_CAMP_FAILED;
        }
-
-        //Activate IMM BPE if active when campaign was started.
-       i_camp->restorePbe();
  
         changeState(i_camp, SmfCampRollbackCompleted::instance());
         LOG_NO("CAMP: Upgrade campaign rollback completed %s", 
i_camp->getCampaignName().c_str());
diff --git a/osaf/services/saf/smfsv/smfd/smfd_campaign_oi.cc 
b/osaf/services/saf/smfsv/smfd/smfd_campaign_oi.cc
--- a/osaf/services/saf/smfsv/smfd/smfd_campaign_oi.cc
+++ b/osaf/services/saf/smfsv/smfd/smfd_campaign_oi.cc
@@ -633,7 +633,8 @@ uint32_t create_campaign_objects(smfd_cb
  */
 uint32_t updateImmAttr(const char *dn, SaImmAttrNameT attributeName, 
SaImmValueTypeT attrValueType, void *value)
 {
-       (void)immutil_update_one_rattr(smfd_cb->campaignOiHandle, dn, 
attributeName, attrValueType, value);
+       SaAisErrorT rc = immutil_update_one_rattr(smfd_cb->campaignOiHandle, 
dn, attributeName, attrValueType, value);
+       osafassert(rc == SA_AIS_OK);
 
        return NCSCC_RC_SUCCESS;
 }
diff --git a/osaf/services/saf/smfsv/smfd/smfd_main.c 
b/osaf/services/saf/smfsv/smfd/smfd_main.c
--- a/osaf/services/saf/smfsv/smfd/smfd_main.c
+++ b/osaf/services/saf/smfsv/smfd/smfd_main.c
@@ -165,8 +165,8 @@ static uint32_t initialize_smfd(void)
 
        /* Set the behaviour of SMF-IMM interactions */
        immutilWrapperProfile.errorsAreFatal = 0;   /* False, no reboot when 
fail */
-       immutilWrapperProfile.nTries         = 500; /* Times */
-       immutilWrapperProfile.retryInterval  = 400; /* MS */
+       immutilWrapperProfile.nTries         = 600; /* Times */
+       immutilWrapperProfile.retryInterval  = 1000; /* MS */
 
        if (ncs_agents_startup() != NCSCC_RC_SUCCESS) {
                LOG_ER("ncs_agents_startup FAILED");

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to