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

Improve servlet22 response status handling #1985

Merged
merged 2 commits into from
Jan 6, 2021

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Jan 5, 2021

If servlet doesn't set response status then currently there is a NPE when casting Integer -> int in Servlet2Advice#stopSpan. This happens when running "test exception" in JettyServlet2Test with other tests commented out. In JettyServlet2Test "test exception" currently passes only when it is run after "test error" as our integration ends up using response status set from previous request, reset response status when creating span to avoid this.

Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

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

nice find 👍

…/opentelemetry/javaagent/instrumentation/servlet/v2_2/Servlet2Advice.java

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Copy link
Contributor

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

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

Thanks!

@anuraaga anuraaga merged commit 2b97c42 into open-telemetry:master Jan 6, 2021
@laurit laurit deleted the servlet22-response-status branch January 6, 2021 09:02
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.

None yet

3 participants