Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-5400

JBossTM (legacy) throws a JBossRollbackException instead of XAException when a time-out occurs during STATUS_COMMITTING

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 4.3.0.GA_CP10
    • 4.3.0.GA_CP08
    • None
    • JBoss EAP 4.3.GA.CP08

    • Not Required

    Description

      It looks like the problem is in org.jboss.tm.TransactionImpl.commit(). This method checks the transaction's status, if it is STATUS_ACTIVE then it, in the case of an XA transaction, prepares the resources (sets status to STATUS_PREPARED) and then commits the resources. During the commit for each of the resources the status is STATUS_COMMITTING. It appears a time-out happens exactly at this point. As the log shows:

      WARN [org.jboss.tm.TransactionImpl] Transaction TransactionImpl:XidImpl[FormatId=257, GlobalId=doron/220, BranchQual=, localId=220] timed out. status=STATUS_COMMITING

      On a transaction timeout when the transaction status is STATUS_COMMITING, org.jboss.tm.TransactionImpl.timedOut(Timeout timeout) sets the status to STATUS_MARKED_ROLLBACK. However, see the comment in the code:

      271 case Status.STATUS_COMMITTING:
      272 // This is very bad:
      273 // We are in the second commit phase, and have decided
      274 // to commit, but now we get a timeout and should rollback.
      275 // So we end up with a mixed decision.
      276 gotHeuristic(null, XAException.XA_HEURMIX);
      277 status = Status.STATUS_MARKED_ROLLBACK;
      278 return; // commit will fail

      This is "very bad" because some of the resources may have already actually committed. It appears that is exactly what happened in this customer's case. Therefore, when org.jboss.tm.TransactionImpl.commit() checks the status again after the commit attempt and sees STATUS_MARKED_ROLLBACK it tries to rollback the resources. However, this resource has already committed and therefore doesn't recognize the Xid that it's given:

      WARN [org.jboss.tm.TransactionImpl] XAException: tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=doron/220, BranchQual=, localId=220] errorCode=XAER_PROTO
      org.jboss.resource.connectionmanager.JBossLocalXAException: wrong xid in rollback: expected: null, got: XidImpl[FormatId=257, GlobalId=doron/220, BranchQual=1, localId=220]
      at org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource.rollback(TxConnectionManager.java:1023)

      Attachments

        Activity

          People

            istudens@redhat.com Ivo Studensky
            rhn-support-toross Tom Ross
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: