Uploaded image for project: 'WildFly Transaction Client'
  1. WildFly Transaction Client
  2. WFTC-24

Failure to connect when dealing with transactions should return XAER_RMFAIL

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.0.0.Beta24
    • None
    • None

      For wildfly-transaction-client, communication errors must be treated with a XAER_RMFAIL code.

      For futher explanation, read the next paragraphs.

      Based of the XA spec (http://pubs.opengroup.org/onlinepubs/009680699/toc.pdf) the XAER_RMFAIL (or XA_RETRY) is the correct XAException error code on commit. Transaction manager behavior is driven by the XAException error codes emitted by RM (https://github.com/jbosstm/narayana/blob/master/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAResourceRecord.java#L494).

      Right now, on commit the error codes are defined as

      [XAER_RMERR]

      An error occurred in committing the work performed on behalf of the transaction branch and the branch’s work has been rolled back. Note that returning this error signals a catastrophic event to a transaction manager since other resource managers may successfully commit their work on behalf of this branch. This error should be returned only when a resource manager concludes that it can never commit the branch and that it cannot hold the branch’s resources in a prepared state. Otherwise, [XA_RETRY] should be returned.

      [XAER_RMFAIL]

      An error occurred that makes the resource manager unavailable.

      XAER_RMERR means some unspecified error which the RM can't recover back. It means that RM arbitrarily rolled back the transaction. On the opposite side the XAER_RMFAIL signifies that there is some temporary issue with RM but it's expected that it will be adjusted during the time. Thus transaction manager leaves the care of it to recovery manager which periodically checks if RM is already ok and tries to finish the transaction.

      Similar thing is valid for prepare and rollback. In general I would summarize that for IOException (some error on network happens and we can expect that will be solved later) XAER_RMFAIL should be rather returned.

              flaviarnn Flavia Rainone
              flaviarnn Flavia Rainone
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: