Ensure reactor netty spans are ended in the order they were started #9203
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 orderhttp.resend_count
attribute is placed on the redirect span.It reproduces when a
sleep
is placed betweenclientContexts.poll()
andinstrumenter().end()
, for some reason it appears to reproduce more easily when running all tests inReactorNettyHttpClientTest
, when you disable/comment out all other tests then this test passes even with the sleep.