Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JBTM-3723 Remove contention point on TransactionManager#transactionManager #2067

Merged
merged 1 commit into from Nov 30, 2022

Conversation

Sanne
Copy link
Contributor

@Sanne Sanne commented Nov 28, 2022

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

Copy link
Contributor

@mmusgrov mmusgrov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Sanne I think it's fine to remove the keyword.
We already perform double checked locking when looking up the transaction manager [1]

Way back in Jul 2006 we used to do the lookup directly:

_transactionManager = (javax.transaction.TransactionManager) Thread.currentThread().getContextClassLoader().loadClass(JNDIManager.getTransactionManagerImplementationClassname()).newInstance();

hence we needed the synchronization, but now we do it via our environment bean

return jtaPropertyManager.getJTAEnvironmentBean().getTransactionManager();

which does the double lock check.

[1] https://github.com/jbosstm/narayana/blob/master/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/JTAEnvironmentBean.java#L192

@mmusgrov
Copy link
Contributor

@jmfinelli this looks like a good change, do you mind if I merge it?

@jbosstm-bot
Copy link

jbosstm-bot commented Nov 28, 2022

AS_TESTS profile tests failed (http://narayanaci1.eng.hst.ams2.redhat.com/job/btny-pulls-narayana/PROFILE=AS_TESTS,jdk=jdk11.latest,label=linux/1257/): AS tests failed

The test failures are unrelated

@jmfinelli
Copy link
Contributor

@jmfinelli this looks like a good change, do you mind if I merge it?

Not at all! LGTM as well!

@Sanne
Copy link
Contributor Author

Sanne commented Nov 28, 2022

@mmusgrov Right, I had also noticed that both getJTAEnvironmentBean and getTransactionManager already have protection mechanisms for concurrent calls. thanks!

@jmfinelli thanks!

FWIW I'll leave backporting choices to you all, but bear in mind it would be great to have this fix available in EAP8.

@jmfinelli
Copy link
Contributor

FWIW I'll leave backporting choices to you all, but bear in mind it would be great to have this fix available in EAP8.

It will be included in our next release, i.e. Narayana 6.0 (which will be part of EAP8)

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@mmusgrov mmusgrov merged commit 3457641 into jbosstm:master Nov 30, 2022
@Sanne Sanne deleted the JBTM-3723 branch November 30, 2022 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants