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

Ensure reactor netty spans are ended in the order they were started #9203

Merged

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Aug 15, 2023

https://ge.opentelemetry.io/s/5q4iabsomwrhg/tests/task/:instrumentation:reactor:reactor-netty:reactor-netty-1.0:javaagent:test/details/io.opentelemetry.javaagent.instrumentation.reactornetty.v1_0.ReactorNettyHttpClientTest/redirectToSecuredCopiesAuthHeader()?expanded-stacktrace=WyIwIl0&top-execution=1
Apparently it is possible for the final request span (200 status) to complete before the redirect span (302 status). As a side effect of ending the spans in wrong order http.resend_count attribute is placed on the redirect span.
It reproduces when a sleep is placed between clientContexts.poll() and instrumenter().end(), for some reason it appears to reproduce more easily when running all tests in ReactorNettyHttpClientTest, when you disable/comment out all other tests then this test passes even with the sleep.

@laurit laurit requested a review from a team August 15, 2023 07:52
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

@mateuszrzeszutek mateuszrzeszutek merged commit 8211886 into open-telemetry:main Aug 16, 2023
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