in tchannel-core/src/main/java/com/uber/tchannel/api/TFuture.java [155:169]
private void popSpan(Span span, Runnable listener) {
if (span != null) {
try { // this _might_ fail in case the listener managed to corrupt the tracing context
Span poppedSpan = tracingContext.popSpan();
if (!span.equals(poppedSpan)) {
logger.error(
"Corrupted tracing context after running listener {}: expected span {} but got {}",
listener, span, poppedSpan
);
}
} catch (EmptyStackException e) {
logger.error("Corrupted (empty) tracing context after running listener {}", listener, e);
}
}
}