Skip to content
Merged
Show file tree
Hide file tree
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 @@ -168,16 +168,16 @@ public void onUpstreamFinish() throws Exception {
@Override
public void onUpstreamFailure(final Throwable ex) throws Exception {
ContextScope scope = scopes.poll();
AgentSpan span = AgentSpan.fromContext(scope.context());
if (scope != null) {
// Mark the span as failed
AgentSpan span = AgentSpan.fromContext(scope.context());
DatadogWrapperHelper.finishSpan(span, ex);
}
// We will not receive any more responses from the user code, so clean up any
// remaining spans
scope = scopes.poll();
while (scope != null) {
span.finish();
AgentSpan.fromContext(scope.context()).finish();
scope = scopes.poll();
}
fail(responseOutlet, ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,16 @@ public void onUpstreamFinish() throws Exception {
@Override
public void onUpstreamFailure(final Throwable ex) throws Exception {
ContextScope scope = scopes.poll();
AgentSpan span = AgentSpan.fromContext(scope.context());
if (scope != null) {
// Mark the span as failed
AgentSpan span = AgentSpan.fromContext(scope.context());
DatadogWrapperHelper.finishSpan(span, ex);
}
// We will not receive any more responses from the user code, so clean up any
// remaining spans
scope = scopes.poll();
while (scope != null) {
span.finish();
AgentSpan.fromContext(scope.context()).finish();
scope = scopes.poll();
}
fail(responseOutlet, ex);
Expand Down