osaf/libs/agents/saf/imma/imma_om_api.c   |  9 +++++++++
 osaf/services/saf/immsv/immnd/ImmModel.cc |  6 ++++--
 osaf/services/saf/immsv/immnd/immnd_evt.c |  7 +++++++
 3 files changed, 20 insertions(+), 2 deletions(-)


A spurious and redundant ccb-apply generated by a faulty code elsewhere shall
be ignored by the immnd server.
Bugs in the imma library or new bugs introduced in the immnd server in the
future should never be able to cause such a serious error as an inconsistent
commit. The problem here was that the arrival of the second apply reaching the
ccb already in critical at some processor(s) caused the ccb to get *aborted*
in imm-ram while being in critical. That should never be allowed to happen.
A ccb in critical is waiting on the commit decision from PBE and PBE alone.
Patch also fixes a potential source of redundant apply in imma_om_api.c
potentially caused by mutithreaded applications (incorrect usage of handle).

diff --git a/osaf/libs/agents/saf/imma/imma_om_api.c 
b/osaf/libs/agents/saf/imma/imma_om_api.c
--- a/osaf/libs/agents/saf/imma/imma_om_api.c
+++ b/osaf/libs/agents/saf/imma/imma_om_api.c
@@ -3174,6 +3174,10 @@ SaAisErrorT saImmOmCcbApply(SaImmCcbHand
                */
                TRACE_3("client_node %p exposed :%u", cl_node, cl_node ? 
(cl_node->exposed) : 0);
 
+               /* Reset the ccb_node flags back to indicate apply is in 
progress. */
+               ccb_node->mExclusive = true; 
+               ccb_node->mApplying = true;
+
                /* Release the CB lock Before MDS Send */
                m_NCS_UNLOCK(&cb->cb_lock, NCS_LOCK_WRITE);
                locked = false;
@@ -3192,7 +3196,12 @@ SaAisErrorT saImmOmCcbApply(SaImmCcbHand
                        } 
                        locked = true;
 
+                       ccb_node = NULL;
                        imma_ccb_node_get(&cb->ccb_tree, &ccbHandle, &ccb_node);
+                       if(ccb_node) {
+                               ccb_node->mExclusive = false; 
+                               ccb_node->mApplying = false;
+                       }
                }
 
                if(rc == SA_AIS_OK) {
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
@@ -4020,8 +4020,9 @@ ImmModel::ccbApply(SaUint32T ccbId,
                 ccb->mAdminOwnerId);
             ccb->mVeto = SA_AIS_ERR_BAD_HANDLE;
         } else if(ccb->mState > IMM_CCB_READY) {
-            LOG_NO("ERR_FAILED_OPERATION: Ccb not in correct state (%u) for 
Apply", ccb->mState);
-            ccb->mVeto = SA_AIS_ERR_FAILED_OPERATION;
+            LOG_NO("Ccb not in correct state (%u) for Apply ignoring request", 
ccb->mState);
+            err = SA_AIS_ERR_ACCESS_DENIED;
+            goto ignore;
         }
 
         osafassert(reqConn==0 || (ccb->mOriginatingConn == reqConn));
@@ -4090,6 +4091,7 @@ ImmModel::ccbApply(SaUint32T ccbId,
             }
         }
     }
+ ignore:
     
     TRACE_LEAVE();
     return err;
diff --git a/osaf/services/saf/immsv/immnd/immnd_evt.c 
b/osaf/services/saf/immsv/immnd/immnd_evt.c
--- a/osaf/services/saf/immsv/immnd/immnd_evt.c
+++ b/osaf/services/saf/immsv/immnd/immnd_evt.c
@@ -6769,6 +6769,12 @@ static void immnd_evt_proc_ccb_apply(IMM
                        }
                } else {
                        SaUint32T client = 0;
+                       if(err == SA_AIS_ERR_ACCESS_DENIED) {
+                               LOG_WA("Spurious and redundant ccb-apply 
request ignored ccbId:%u",
+                                       evt->info.ccbId);
+                               /* Dont touch the ccb object and dont even 
reply to the client. */
+                               goto done;
+                       }
                        /*err != SA_AIS_OK => generate SaImmOiCcbAbortCallbackT 
upcalls
                         */
                        immnd_evt_ccb_abort(cb, evt->info.ccbId, &client);
@@ -6795,6 +6801,7 @@ static void immnd_evt_proc_ccb_apply(IMM
                        }
                }
        }
+ done:
        TRACE_LEAVE();
 }
 

------------------------------------------------------------------------------
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