Skip to content

Glassfish: prevent blacklisting of specific classes and dump stacktrace in debug mode if this happens#839

Merged
labbati merged 13 commits into
masterfrom
labbati/jdbc-error-glasshfish
May 29, 2019
Merged

Glassfish: prevent blacklisting of specific classes and dump stacktrace in debug mode if this happens#839
labbati merged 13 commits into
masterfrom
labbati/jdbc-error-glasshfish

Conversation

@labbati
Copy link
Copy Markdown
Member

@labbati labbati commented May 17, 2019

Interesting links:

When a resource is loaded by the Glassfish class loader and it is not loadable it gets added to a blacklist. Such blacklist is then used to prevent further attempts when the classes is loaded.

For a reason that was not clear, it looks like an opentracing class was attempted to be loaded too early in glassfish. We were not able to reproduce it locally so I cannot provide further details as of now. We were only able to observe on a customer's server. This did not allow us to perform a more in-depth investigation.

This PR proposes a workaround, we do not blacklist opentracing resources from being loaded (or attempted to be loaded) again when they are not found.

We had the option of preventing blacklist to be avoid when reading it or when writing it. We decided to hook into the write because the read method is read for EACH class loaded, while the write method only for resources that are not found.

@labbati labbati added this to the 0.28.0 milestone May 17, 2019
@labbati labbati added the comp: core Tracer core label May 17, 2019
@labbati labbati modified the milestones: 0.28.0, 0.29.0 May 17, 2019
@labbati labbati force-pushed the labbati/jdbc-error-glasshfish branch from da91800 to 19d9880 Compare May 24, 2019 09:41
@labbati labbati marked this pull request as ready for review May 24, 2019 09:41
@labbati labbati requested a review from tylerbenson May 24, 2019 09:57
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.

Use BOOTSTRAP_PACKAGE_PREFIXES instead.
Also, I think this might work better as a separate integration.

@labbati labbati requested a review from a team as a code owner May 27, 2019 13:17
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.

Please improve the version range muzzle check.

Comment thread dd-java-agent/instrumentation/glassfish-4.1/glassfish-4.1.gradle Outdated
@labbati labbati merged commit 7ec8339 into master May 29, 2019
@tylerbenson tylerbenson deleted the labbati/jdbc-error-glasshfish branch May 29, 2019 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: core Tracer core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants