Bug 1378454 - [GSS](6.4.z) The outcome of xa_commit call on non exiting transaction is silently ignored
Summary: [GSS](6.4.z) The outcome of xa_commit call on non exiting transaction is sile...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: EJB, Transaction Manager
Version: 6.4.9
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: CR1
: EAP 6.4.15
Assignee: Fedor Gavrilov
QA Contact: Jiří Bílek
URL:
Whiteboard:
Depends On: 1378396
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-22 12:52 UTC by Tom Ross
Modified: 2021-03-11 14:43 UTC (History)
15 users (show)

Fixed In Version:
Clone Of: 1378396
Environment:
Last Closed: 2018-01-22 22:14:37 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBEAP-7616 0 Blocker Closed (7.0.z) The outcome of xa_commit call on non exiting transaction is silently ignored 2018-11-05 10:17:48 UTC
Red Hat Knowledge Base (Article) 3023051 0 None None None 2017-05-04 07:54:31 UTC

Internal Links: 1464176 1468539

Description Tom Ross 2016-09-22 12:52:26 UTC
This from mail thread on transactional mailing list:
There is definitely a bug in EJBR.
 
These two at least look wrong by inspection:
https://github.com/wildfly/wildfly/blob/master/ejb3/src/main/java/org/jboss/as/ejb3/remote/protocol/versionone/XidTransactionPrepareTask.java#L100
https://github.com/wildfly/wildfly/blob/master/ejb3/src/main/java/org/jboss/as/ejb3/remote/protocol/versionone/XidTransactionCommitTask.java#L68
 
The way they are implemented means that when the transaction manager calls commit/prepare on an Xid if there is no transaction at the remote side EJBR just ignores the problem whereas it needs to return an XA error so the TM knows about it.
 
You could simulate this with a test case that gets hold of the EJBR XAResource and invokes:
xar.prepare(dummyXid) and does not get back XAER_NOTA
 
That explains how the root transaction can prepare/commit without error as we can see here:
 
2016-09-12 16:04:02,303 TRACE [com.arjuna.ats.jta] (EJB async - 8) XAResourceRecord.topLevelPrepare for XAResourceRecord < resource:ResourceImpl{transactionKey=0:ffff0af7f6b6:6b296e38:57d14447:63f2e, ejbClientContext=org.jboss.ejb.client.EJBClientContext@18d6826a, nodeName='svc-2-presentation', state=State{transactionID=org.jboss.ejb.client.XidTransactionID@303ce194, suspended=false, participantCnt=0}}, txid:< formatId=131077, gtrid_length=46, bqual_length=36, tx_uid=0:ffff0af7f6b6:6b296e38:57d14447:63f2e, node_name=svc_2_presentation, branch_uid=0:ffff0af7f6b6:6b296e38:57d14447:63f4a, subordinatenodename=null, eis_name=unknown eis name >, heuristic: TwoPhaseOutcome.FINISH_OK com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord@1754f10f >, record id=0:ffff0af7f6b6:6b296e38:57d14447:63f4b
 
2016-09-12 16:04:02,364 TRACE [com.arjuna.ats.jta] (EJB async - 8) XAResourceRecord.topLevelCommit for XAResourceRecord < resource:ResourceImpl{transactionKey=0:ffff0af7f6b6:6b296e38:57d14447:63f2e, ejbClientContext=org.jboss.ejb.client.EJBClientContext@18d6826a, nodeName='svc-2-presentation', state=null}, txid:< formatId=131077, gtrid_length=46, bqual_length=36, tx_uid=0:ffff0af7f6b6:6b296e38:57d14447:63f2e, node_name=svc_2_presentation, branch_uid=0:ffff0af7f6b6:6b296e38:57d14447:63f4a, subordinatenodename=null, eis_name=unknown eis name >, heuristic: TwoPhaseOutcome.FINISH_OK com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord@1754f10f >, record id=0:ffff0af7f6b6:6b296e38:57d14447:63f4b
 
Both those lines I indicated above have debug statements but they should be ERROR and return appropriate XA exceptions.
 
What it does not explain is why the transaction is initially imported 45 minutes later. I guess it is stuck in some EJB processing queue.

Comment 13 Jiří Bílek 2017-04-26 15:00:41 UTC
I used test from crashrec testsuite for reproducing the issue

mvn clean verify -Djboss.dist=$JBOSS_HOME -Dtest=TxPropagationEJbXAResourceTestCase -Deap6 -DfailIfNoTests=false

Non exiting transaction is still silently ignored -> Reopened.


Note You need to log in before you can comment on or make changes to this bug.