osaf/services/saf/immsv/immnd/ImmModel.cc |  28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)


The function ImmModel::immNotPbeWritable() is made time insensitive.
Root cause of the problem was that this function depended on a
timeout in waiting on ccbs in critical, but the threshold for
deciding on this timeout was not fevs safe. That is the timeout could
be flagged on some nodes but not others, at the same fevs event i.e.
the ccb-apply. The function instead counts the *number* of ccbs that
are in critical i.e. waiting only on reply from PBE.

diff --git a/osaf/services/saf/immsv/immnd/ImmModel.cc 
b/osaf/services/saf/immsv/immnd/ImmModel.cc
--- a/osaf/services/saf/immsv/immnd/ImmModel.cc
+++ b/osaf/services/saf/immsv/immnd/ImmModel.cc
@@ -32,6 +32,7 @@
 #define DEFAULT_TIMEOUT_SEC 6 /* Should be saImmOiTimeout in SaImmMngt */
 #define PRT_LOW_THRESHOLD 1 /* See ImmModel::immNotPbeWritable */
 #define PRT_HIGH_THRESHOLD 4 /* See ImmModel::immNotPbeWritable */
+#define CCB_CRIT_THRESHOLD 8 /* See ImmModel::immNotPbeWritable */
 
 
 struct ContinuationInfo2
@@ -1742,22 +1743,21 @@ ImmModel::immNotPbeWritable(bool isPrtoC
 
     /* Pbe is present but Check also for backlog. */
 
-    time_t now = time(NULL);
-    bool ccbStuck = false;
+    unsigned int ccbsInCritical = 0;
     CcbVector::iterator i3 = sCcbVector.begin();
     for(; i3!=sCcbVector.end(); ++i3) {
-        if((*i3)->mState == IMM_CCB_CRITICAL &&
-           (((*i3)->mWaitStartTime && 
-             now - (*i3)->mWaitStartTime >= DEFAULT_TIMEOUT_SEC)||/* Should be 
saImmOiTimeout*/
-           (*i3)->mPbeRestartId))
-        {
-            ccbStuck=true;
-            break;
-        }
-    }
-
-    /* If one ore more ccbs are stuck, reject any new persistifications. */
-    if(ccbStuck) {return true;} 
+        if((*i3)->mState == IMM_CCB_CRITICAL) {
+            ccbsInCritical++;
+
+            if((*i3)->mPbeRestartId) {
+                /* PBE was restarted with a ccb in critical. */
+                return true;
+            }
+        }
+    }
+
+    /* If too many ccbs are already critical then delay new ccbs. */
+    if(ccbsInCritical > CCB_CRIT_THRESHOLD) {return true;} 
 
     /* Finally, be extra stringent PRTO/PRTA changes: 
        PrtCreate, PrtUpdate, PrtDelete

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to