Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,19 @@ public void onUpstreamFailure(final Throwable ex) throws Exception {
// Mark the span as failed
AgentSpan span = fromContext(scope.context());
DatadogWrapperHelper.finishSpan(span, ex);

// Clean up the leaked scope like in the normal response path
AgentSpan activeSpan = activeSpan();
if (activeSpan == span) {
scope.close();
}
}
// We will not receive any more responses from the user code, so clean up any
// remaining spans
scope = scopes.poll();
while (scope != null) {
fromContext(scope.context()).finish();
scope.close();
scope = scopes.poll();
}
fail(responseOutlet, ex);
Expand Down
Loading