Skip to content

Reduce use of Thread::setContextClassLoader and hard references to DatadogClassLoader#1204

Merged
lpriima merged 1 commit into
masterfrom
lpriima/reduce_use_of_Thread#setContextClassLoader
Feb 7, 2020
Merged

Reduce use of Thread::setContextClassLoader and hard references to DatadogClassLoader#1204
lpriima merged 1 commit into
masterfrom
lpriima/reduce_use_of_Thread#setContextClassLoader

Conversation

@lpriima
Copy link
Copy Markdown
Contributor

@lpriima lpriima commented Feb 7, 2020

Specify explicit AgentInstaller class loader instead of storing reference to context class loader in current thread object. We can install agent by ServiceLoader::load(Class, ClassLoader) and without this call
https://hg.openjdk.java.net/jdk7u/jdk7u-dev/jdk/file/70e3553d9d6e/src/share/classes/java/util/ServiceLoader.java#l498

@lpriima lpriima requested review from a team and dougqh February 7, 2020 03:36
@lpriima lpriima force-pushed the lpriima/reduce_use_of_Thread#setContextClassLoader branch from 9b77446 to 5265a43 Compare February 7, 2020 03:53
@lpriima lpriima marked this pull request as ready for review February 7, 2020 04:24
Comment thread CONTRIBUTING.md
* Editor > Code Style > Java/Groovy > Imports
* Class count to use import with '*': `50` (some number sufficiently large that is unlikely to matter)
* Names count to use static import with '*': `50`
* Class count to use import with '*': `9999` (some number sufficiently large that is unlikely to matter)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for updating this.

Copy link
Copy Markdown
Contributor

@dougqh dougqh left a comment

Choose a reason for hiding this comment

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

I think the change looks good, but I would like someone a little more familiar with the core to confirm.

@dougqh dougqh requested a review from tylerbenson February 7, 2020 14:45
@lpriima lpriima merged commit 0acd087 into master Feb 7, 2020
@lpriima lpriima deleted the lpriima/reduce_use_of_Thread#setContextClassLoader branch February 7, 2020 19:02
@tylerbenson tylerbenson added this to the 0.43.0 milestone Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants