Status: Closed (View Workflow)
Affects Version/s: 10.0.0.Final
Fix Version/s: 12.0.0.Final
Steps to Reproduce:
Crash recovery testsuite could be used to get the described behavior
Crash recovery testsuite could be used to get the described behavior git clone http://git.app.eng.bos.redhat.com/git/jbossqe-eap-tests-transactions.git cd jbossqe-eap-tests-transactions download and unzip EAP 7.0.0.GA export JBOSS_HOME=path/to/er7 mvn clean verify -am -pl jbossts -DfailIfNoTests=false -fn -Dtest=JMSBrokerTimeoutTestCase -Djbossts.noJTS
- git clone http://git.app.eng.bos.redhat.com/git/jbossqe-eap-tests-transactions.git
- cd jbossqe-eap-tests-transactions
- download and unzip EAP 7.0.0.GA
- export JBOSS_HOME=path/to/er7
- mvn clean verify -am -pl jbossts -DfailIfNoTests=false -fn -Dtest=JMSBrokerTimeoutTestCase -Djbossts.noJTS
By creating testcases for checking behavior of transaction timeout I've hit an issue of wrong error code being returned when broker transaction timeout is hit before TM transaction timeout expires.
It uses XAER_PROTO instead of RBTIMEOUT.
This issue does not cause data inconsistency.
- ejb sends a message to a queue
- processing inside of the ejb takes long time
- TM transaction timeout is set big enough to not hit the timeout
- jms broker internal transaction timeout is smaller than time needed for processing ejb method
- jms broker txn timeout occurs - broker local txn is rolled back
- txn is removed from list of broker's local in-process transactions
- TM calls XAResource.end
- the call returns XAException.XAER_PROTO
That's current implementation returns XAER_PROTO in this scenario but RBTIMEOUT would be more appropriate.
From discussion with Narayana developers, RM should return the most specific error return code as possible. In this scenario it's RBTIMEOUT.
Other notes from TM dev point of view:
per XA spec page 39.
The more complex question is, at what point can the resource manager forget about that branch (and therefore return NOTA to subsequent calls)?
The XA spec says "After the transaction manager calls xa_end(), it should no longer consider the calling thread associated with that resource manager (although it must consider the resource manager part of the transaction branch when it prepares the branch.)"
which implies the branch is still considered live at that point, a view corroborated by:
Exception being thrown