[jboss-svn-commits] JBL Code SVN: r38055 - labs/jbosstm/branches/JBOSSTS_4_16/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Apr 25 03:54:34 EDT 2012


Author: paul.robinson
Date: 2012-04-25 03:54:13 -0400 (Wed, 25 Apr 2012)
New Revision: 38055

Modified:
   labs/jbosstm/branches/JBOSSTS_4_16/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/ParticipantEngine.java
Log:
JBTM-1135 TestATSubordinateCrashDuringPrepare fails: Resend to rollback participant not handled correctly

Modified: labs/jbosstm/branches/JBOSSTS_4_16/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/ParticipantEngine.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_16/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/ParticipantEngine.java	2012-04-25 06:34:09 UTC (rev 38054)
+++ labs/jbosstm/branches/JBOSSTS_4_16/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/ParticipantEngine.java	2012-04-25 07:54:13 UTC (rev 38055)
@@ -222,20 +222,21 @@
             }
         }
 
-        if (current != State.STATE_COMMITTING)
+        if ((current == State.STATE_ACTIVE) || (current == State.STATE_PREPARING) ||
+            (current == State.STATE_PREPARED_SUCCESS))
         {
-            if ((current == State.STATE_ACTIVE) || (current == State.STATE_PREPARING) ||
-                (current == State.STATE_PREPARED_SUCCESS))
-            {
-                // n.b. if state is PREPARING the participant may still be in the middle
-                // of prepare or may even be told to prepare after this is called. according
-                // to the spec that is not our lookout. however, rollback should only get
-                // called once here.
+            // n.b. if state is PREPARING the participant may still be in the middle
+            // of prepare or may even be told to prepare after this is called. according
+            // to the spec that is not our lookout. however, rollback should only get
+            // called once here.
 
-                if (!executeRollback())
+            if (!executeRollback())
+            {
+                synchronized (this)
                 {
-                    return ;
+                    state = current;
                 }
+                return ;
             }
 
             // if the participant managed to persist the log record then we should try
@@ -249,18 +250,16 @@
                 if (!XTSATRecoveryManager.getRecoveryManager().deleteParticipantRecoveryRecord(id)) {
                     // hmm, could not delete entry -- leave it so we can maybe retry later
                     WSTLogger.i18NLogger.warn_wst11_messaging_engines_ParticipantEngine_rollback_1(id);
-
-                    return;
                 }
             }
 
             sendAborted() ;
-
-            if (current != null)
-            {
-                forget() ;
-            }
+            forget() ;
         }
+        else if (current != State.STATE_ABORTING)
+        {
+            sendAborted();
+        }
     }
 
     /**
@@ -379,7 +378,7 @@
      * Handle the commit decision event.
      *
      * Preparing -> PreparedSuccess (send Prepared)
-     * Committing -> Committing (send committed and forget)
+     * Committing -> null (send committed and forget)
      */
     private void commitDecision()
     {



More information about the jboss-svn-commits mailing list