-
Notifications
You must be signed in to change notification settings - Fork 994
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
[improve]improve code #2523
[improve]improve code #2523
Conversation
public JmxCollectImpl() { | ||
connectionCommonCache = new ConnectionCommonCache<>(); | ||
Thread.currentThread().setContextClassLoader(new ClassLoaderConfig(ClassLoader.getSystemClassLoader())); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, this seem can not work due the constructor new JmxCollectImpl() is call by the thread-A and JmxCollectImpl is singleton, but the JmxCollectImpl.collect
is run by another thread-B in running-thread-pool. Thread.currentThread().setContextClassLoader
only can take effect on the current thread.
Signed-off-by: tomsun28 <tomsun28@outlook.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2523 +/- ##
============================================
- Coverage 28.65% 28.62% -0.03%
+ Complexity 1640 1639 -1
============================================
Files 445 446 +1
Lines 18121 18133 +12
Branches 2338 2339 +1
============================================
- Hits 5192 5191 -1
- Misses 12340 12354 +14
+ Partials 589 588 -1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.👍
What's changed?
improve code
Checklist