Bug 1410065 - [GSS](6.4.z) XA resource with same RMid are not ended properly
Summary: [GSS](6.4.z) XA resource with same RMid are not ended properly
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: EJB, Transaction Manager
Version: 6.4.7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Peter Palaga
QA Contact: Jan Martiska
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-04 11:36 UTC by Amit
Modified: 2020-12-14 07:58 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-10 17:37:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Reproducer (40.53 KB, application/zip)
2017-01-04 11:36 UTC, Amit
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBEAP-8088 0 Critical Reopened [GSS](7.2.z) XA resource with same RMid are not ended properly 2018-11-28 16:36:40 UTC
Red Hat Issue Tracker JBEAP-8227 0 Major Reopened [GSS](7.0.z) XA resource with same RMid are not ended properly 2018-11-28 16:36:40 UTC

Description Amit 2017-01-04 11:36:06 UTC
Created attachment 1237094 [details]
Reproducer

A scenario with a EJB XA transaction between two applications (war).  The process is the following:

1. a client GUI is calling a remote EJB on project 1 that initiate the XA transaction.
2. The project 1 call a remote EJB on project 2 that create a new branch in XA transaction
3. the project 2 enlist two XA resources that share the same RMid. 
4. EJB call on both project 2 and project 1 and 2PC is initiated by project 1 to commit the XA transaction.

The expected behaviour is that "start" and "end" operations are called on both XA resource enlisted in project 2 as mentioned in JTA/XA specifications.


How reproducible:

Please find attached reproducer.zip


Steps to Reproduce: 

1) Deploy the 2 wars (project 1 and project 2) in the same Jboss server.

2) Run the GUI client (mvn exec:java in sources files folder)


Actual results: 

following logs shows that "end" method is only called on  XAResource 1.


09:18:34,564 INFO  { } [stdout] (EJB default - 1) start resource2 xid=< formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffffac129ea0:6ee503a4:5864c6a7:11, node_name=1, branch_uid=0:ffffac129ea0:6ee503a4:5864c6a7:17, subordinatenodename=null, eis_name=unknown eis name >

09:18:34,565 INFO  { } [stdout] (EJB default - 1) end resource1 xid=< formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffffac129ea0:6ee503a4:5864c6a7:11, node_name=1, branch_uid=0:ffffac129ea0:6ee503a4:5864c6a7:17, subordinatenodename=null, eis_name=unknown eis name >

09:18:34,565 INFO  { } [stdout] (EJB default - 1) prepare resource1 xid=< formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffffac129ea0:6ee503a4:5864c6a7:11, node_name=1, branch_uid=0:ffffac129ea0:6ee503a4:5864c6a7:17, subordinatenodename=null, eis_name=unknown eis name >

09:18:34,574 INFO  { } [stdout] (EJB default - 1) commit resource1 xid=< formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffffac129ea0:6ee503a4:5864c6a7:11, node_name=1, branch_uid=0:ffffac129ea0:6ee503a4:5864c6a7:17, subordinatenodename=null, eis_name=unknown eis name >


Expected results is that "start" and "end" operations are called on both XA resource enlisted in project 2 as mentioned in JTA/XA specifications.

But the following logs shows that "end" method is only called on  XAResource 1.


Additional Info: I have consolidated all the wars in folder name reproducer.zip.

Comment 1 Peter Palaga 2017-02-09 13:42:53 UTC
Citing Mike Musgrove from the upstream Jira [1]:

> After consulting the JTA spec (section 3.3.1 Resource Enlistment of the JTA
> spec) I am of the opinion that this is not a bug.
> The isSameRM() call is so that a TM can optimise away redundant calls to
> start/end (which are expensive). If we have already, in this process, called
> end on a XAResource for which isSameRM has returned true then know we do not
> need to call end a second time. On the other hand if it were in a different
> process then, yes I agree, we would to need to call start/end again.
> Also notice that the spec is explicit about the prepare/commit calls in the
> sense that it says that prepare/commit calls should not be issued on two
> resources that have the same RM (section 3.3.1):
>
>> ... and ensures that the same resource manager only receives one set of
>> prepare-commit calls for completing the target global transaction
>

[1] https://issues.jboss.org/browse/JBEAP-8088?focusedCommentId=13361072&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13361072

Comment 2 Brad Maxwell 2017-02-10 17:37:57 UTC
Closing as per engineering response, that this is not a bug according to the specification


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