Skip to content

Commit

Permalink
Ensure reactor netty spans are ended in the order they were started (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
laurit authored Aug 16, 2023
1 parent 31b90b1 commit 8211886
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ Context startClientSpan(HttpClientRequest request) {
return context;
}

void endClientSpan(@Nullable HttpClientResponse response, @Nullable Throwable error) {
// we are synchronizing here to ensure that spans are ended in the oder they are read from the
// queue
synchronized void endClientSpan(
@Nullable HttpClientResponse response, @Nullable Throwable error) {
RequestAndContext requestAndContext = clientContexts.poll();
if (requestAndContext != null) {
instrumenter().end(requestAndContext.context, requestAndContext.request, response, error);
Expand Down

0 comments on commit 8211886

Please sign in to comment.