Skip to content

Fix class loading instrumentation#1275

Merged
tylerbenson merged 1 commit into
DataDog:masterfrom
trask:fix-class-loading-instrumentation
Mar 2, 2020
Merged

Fix class loading instrumentation#1275
tylerbenson merged 1 commit into
DataDog:masterfrom
trask:fix-class-loading-instrumentation

Conversation

@trask
Copy link
Copy Markdown
Contributor

@trask trask commented Feb 29, 2020

Need to reset CallDepthThreadLocalMap before leaving @OnMethodEnter (not waiting until @OnMethodExit).

Otherwise it will prevent the loadClass() instrumentation from being applied when loadClass() ends up calling a ClassFileTransformer which ends up calling loadClass() further down the stack (since the call depth check would then suppress the nested loadClass instrumentation). Which can lead to ClassNotFoundException/NoClassDefFoundError on the agent's bootstrap classes that should be visible to all class loaders.

Ran into this while testing on JBoss. 🙁

@trask trask marked this pull request as ready for review March 1, 2020 00:51
@trask trask requested a review from a team as a code owner March 1, 2020 00:51
Copy link
Copy Markdown
Contributor

@tylerbenson tylerbenson left a comment

Choose a reason for hiding this comment

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

Thanks for the update!

@tylerbenson tylerbenson merged commit abd115c into DataDog:master Mar 2, 2020
@daparthi001
Copy link
Copy Markdown

@tylerbenson is this new change integrated part of the newbuild ?

@daparthi001
Copy link
Copy Markdown

@tylerbenson when will you release new jar with 1275 code ?

@tylerbenson
Copy link
Copy Markdown
Contributor

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