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

Skip @Decorator classes when instrumenting #1045

Merged
merged 3 commits into from
Oct 17, 2019

Conversation

randomanderson
Copy link
Contributor

@randomanderson randomanderson commented Oct 16, 2019

In CDI (Contexts and Dependency Injection) environments, classes annotated with @Decorator wrap other classes. Decorators implement the same interfaces but delegate to another class. See the Oracle docs.

In general, the tracer should instrument the delegate (decorated class) and not the decorator. When the tracer instruments the decorator, it cause the CDI container to be confused about the interfaces of the decorator and crash on startup.

This pull request changes that behavior.

I added a CDI project that contains no instrumentation and just a test (like the vertx project). The test tests a specific crash that happened because of the interaction between the RunnableCallableInstrumentation and RunnableDecorator. In the future, more instrumentation and/or tests can be added if necessary.

@randomanderson randomanderson requested a review from a team as a code owner October 16, 2019 21:24
@randomanderson randomanderson force-pushed the landerson/decorator-errors branch from e161664 to 6e0af7c Compare October 16, 2019 22:26
Copy link
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.

Looks good to me. Thanks for the nice write up explaining the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants