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-3273 -> Avoid implementing InvocationHandler in jtaLogger #1590

Merged
merged 1 commit into from
Apr 15, 2020

Conversation

mayankkunwar
Copy link
Contributor

@mayankkunwar mayankkunwar commented Apr 8, 2020

https://issues.redhat.com/browse/JBTM-3273

!MAIN
!QA_JTS_JACORB
!QA_JTS_JDKORB
!QA_JTS_OPENJDKORB
AS_TESTS JDK11
!PERF
!XTS
!CORE
!BLACKTIE
!RTS
!mysql
!postgres
!db2
!oracle
!TOMCAT
!JACOCO
!LRA

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm jbosstm deleted a comment from jbosstm-bot Apr 8, 2020
@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

Benchmark output (please refer to the article https://developer.jboss.org/wiki/PerformanceGatesForAcceptingPerformanceFixesInNarayana for information on our testing procedures.

If you just want to run a single benchmark then please refer to the README.md file in our benchmark repository at https://github.com/jbosstm/performance/tree/master/narayana

JMH benchmark run (with args -t 240 -r 25 -f 2 -wi 5 -i 5)

Comparison (pull request versus master)
(changes within the % range [-10.000000, 10.000000] are regarded as insignificant):

com.hp.mwtests.ts.arjuna.performance.Performance1.twoPhaseTest: 3383082.248213 vrs 3757645.428961 (0.000000%: no change)
com.hp.mwtests.ts.arjuna.performance.Performance1.onePhaseTest: 4551413.608962 vrs 3894094.887252 (0.000000%: no change)
com.arjuna.ats.jta.xa.performance.JTAStoreTests.jtaTest: 765694.001497 vrs 1172242.527693 (-34.681264%: regression)

For information on the hardware config used for this PR please consult the CI job artefact hwinfo.txt or the job output

If the purpose of this PR is to improve performance then there has been insufficient improvement to warrant a pass. See the previous text for the threshold (range) for passing optimization related PRs

@jbosstm-bot
Copy link

PERFORMANCE profile tests failed (http://narayanaci1.eng.hst.ams2.redhat.com/job/btny-pulls-narayana-PERF/PROFILE=PERFORMANCE,jdk=jdk8.latest,label=linux/10/): there were regressions in one or more of the benchmarks (see previous PR comment for details

@jbosstm-bot
Copy link

@mayankkunwar
Copy link
Contributor Author

Since the changes are not what was expected, till then I will put this PR on Hold.

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

Benchmark output (please refer to the article https://developer.jboss.org/wiki/PerformanceGatesForAcceptingPerformanceFixesInNarayana for information on our testing procedures.

If you just want to run a single benchmark then please refer to the README.md file in our benchmark repository at https://github.com/jbosstm/performance/tree/master/narayana

JMH benchmark run (with args -t 240 -r 25 -f 2 -wi 5 -i 5)

Comparison (pull request versus master)
(changes within the % range [-10.000000, 10.000000] are regarded as insignificant):

com.hp.mwtests.ts.arjuna.performance.Performance1.twoPhaseTest: 2403901.274610 vrs 2985881.734765 (-19.491075%: regression)
com.hp.mwtests.ts.arjuna.performance.Performance1.onePhaseTest: 4471694.654462 vrs 4381307.038140 (0.000000%: no change)
com.arjuna.ats.jta.xa.performance.JTAStoreTests.jtaTest: 1132821.080809 vrs 942370.484518 (0.000000%: no change)

For information on the hardware config used for this PR please consult the CI job artefact hwinfo.txt or the job output

If the purpose of this PR is to improve performance then there has been insufficient improvement to warrant a pass. See the previous text for the threshold (range) for passing optimization related PRs

@jbosstm-bot
Copy link

PERFORMANCE profile tests failed (http://narayanaci1.eng.hst.ams2.redhat.com/job/btny-pulls-narayana-PERF/PROFILE=PERFORMANCE,jdk=jdk8.latest,label=linux/12/): there were regressions in one or more of the benchmarks (see previous PR comment for details

@ochaloup ochaloup added the NoCI marking pull request as for not running CI tests label Apr 8, 2020
@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@mayankkunwar mayankkunwar removed Hold NoCI marking pull request as for not running CI tests labels Apr 9, 2020
@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

@jbosstm-bot
Copy link

Started testing this pull request with AS_TESTS profile: http://narayanaci1.eng.hst.ams2.redhat.com/job/ochaloup-test/PROFILE=AS_TESTS,jdk=jdk8.latest,label=linux/1/

@jbosstm-bot
Copy link

Started testing this pull request with QA_JTA profile: http://narayanaci1.eng.hst.ams2.redhat.com/job/ochaloup-test/PROFILE=QA_JTA,jdk=jdk8.latest,label=linux/1/

@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

@mayankkunwar
Copy link
Contributor Author

@ochaloup could you please review the code.

@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.

@ochaloup These changes look good to go.

@mayankkunwar
Copy link
Contributor Author

Thanks for the approval. I will merge it now

@mayankkunwar mayankkunwar merged commit 46366bd into jbosstm:master Apr 15, 2020
@ochaloup
Copy link
Contributor

@mmusgrov @mayankkunwar I'm sorry for not getting to this sooner. I will try better next time.
Still I consider there is at least one pitfall in the concurrency handling. I consider the JBTM-3273 as not fully finished yet. I need to check this in more details and I will let you know back.

@mayankkunwar
Copy link
Contributor Author

Okay @ochaloup .. Thanks

Copy link
Contributor

@ochaloup ochaloup left a comment

Choose a reason for hiding this comment

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

I put down to the code few comments but as I went through this more closely, listing the changes, I can see the all reports of the recovery failure go to the class XARecoveryModule. There is no other place considered as place to report the information about recovery failure from.

So we don't need open the API out of the recovery module. This separate class RecoveryRequired (or any rather one using more fitting name) could be created as package private besides the XARecoveryModule or the flag could be placed directly to the XARecoveryModule class.

@mayankkunwar Please, refactor the code in this way or let's discuss the reasons on other decision.

@@ -0,0 +1,14 @@
package com.arjuna.ats.jta.logging;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure about the placing the class under the logging package. As it informs about recovery processing it makes more sense to me to put it under recovery package. What was your reasoning about placing it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since this class is only used by jtaLogger for now, therefore I thought of placing it under com.arjuna.ats.jta.logging package would be fine for now. Maybe later if any other package requires it, then we could move it under recovery package?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will move it to recovery package

@@ -0,0 +1,14 @@
package com.arjuna.ats.jta.logging;

public class RecoveryRequired {
Copy link
Contributor

Choose a reason for hiding this comment

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

What is your reasoning for naming the class as RecoveryRequired?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought it would add meaning to the action, that user has to take after he gets the result.


public class RecoveryRequired {

private static boolean recoveryProblems;
Copy link
Contributor

Choose a reason for hiding this comment

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

As this is a flag which is used to mark if a recovery problem occurs and this flag could be accessed from different threads and value could be set from the different threads then the code has to(!) consider that. The property should be of type atomic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry I missed this thought. Thanks for pointing this out. I will make it thread safe.

new jtaLogger(Logger.getMessageLogger(jtaI18NLogger.class, "com.arjuna.ats.jta")));

/**
* For jtaI18NLogger, if any method, prefixed with <b>"warn_recovery"</b> is called then,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is a good comment but I consider it should be put into the class jtaI18Logger as it's the place where new methods for logging are added (and where the methods are named). I think when it's here it's better chance to be missed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I will move the comments to jtaI18Logger

@jbosstm-bot
Copy link

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