[jbossts-issues] [JBoss JIRA] (JBTM-1431) LastResourceRecord.shouldAdd allows insertion regardless of order and type info
RH Bugzilla Integration (JIRA)
jira-events at lists.jboss.org
Wed Aug 28 18:39:26 EDT 2013
[ https://issues.jboss.org/browse/JBTM-1431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12800000#comment-12800000 ]
RH Bugzilla Integration commented on JBTM-1431:
-----------------------------------------------
James Livingston <jlivings at redhat.com> made a comment on [bug 1002330|https://bugzilla.redhat.com/show_bug.cgi?id=1002330]
+++ This bug was initially created as a clone of Bug #1001909 +++
Due to https://issues.jboss.org/browse/JBTM-1431, it is possible for a last resource (e.g. non-XA resource) to be committed prior to another XA resource, which is unsafe.
This was fixed in master prior to 6.1, but not in a bugfix release so was not pulled into EAP.
--- Additional comment from James Livingston on 2013-08-29 08:36:19 EST ---
Fix backported to 4.17 branch by Tom, https://github.com/jbosstm/narayana/commit/986d7792d2dbcc5d01844a5f2240a31a1f5d78b2
> LastResourceRecord.shouldAdd allows insertion regardless of order and type info
> -------------------------------------------------------------------------------
>
> Key: JBTM-1431
> URL: https://issues.jboss.org/browse/JBTM-1431
> Project: JBoss Transaction Manager
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Transaction Core
> Affects Versions: 4.17.3
> Reporter: Mark Little
> Assignee: Mark Little
> Fix For: 4.17.9, 5.0.0.M2
>
>
> So looking at the code, LastResource is meant to be ordered last in the intentions list (check topLevelPrepare to see this). However, a quick look at the code in LastResourceRecord shows that there is a bug:
> public boolean shouldAdd (AbstractRecord a)
> {
> if (a.typeIs() == typeIs())
> {
> if (ALLOW_MULTIPLE_LAST_RESOURCES) {
> if (!_disableMLRWarning
> || (_disableMLRWarning && !_issuedWarning)) {
> tsLogger.i18NLogger.warn_lastResource_multipleWarning(a.toString());
> _issuedWarning = true;
> }
> return true;
> }
> else {
> tsLogger.i18NLogger.warn_lastResource_disallow(this.toString(), a.toString());
> return false;
> }
> }
> else
> {
> return true; <------- Here is the bug!
> }
> }
> Basically if the record to be added is not a LastResourceRecord then it gets added immediately, ignoring any further checks on type, order etc. This is wrong.
> And looking back at the code from 6 years ago we see that this was much simpler:
> public boolean shouldAdd (AbstractRecord a)
> {
> return (a.typeIs() == typeIs()) ;
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jbossts-issues
mailing list