Fix remove PendingTrace from span cleaner bug
This commit is contained in:
parent
9d4933011e
commit
e0837efb5b
|
@ -205,6 +205,7 @@ public class PendingTrace extends ConcurrentLinkedDeque<DDSpan> {
|
|||
while ((ref = referenceQueue.poll()) != null) {
|
||||
weakReferences.remove(ref);
|
||||
if (isWritten.compareAndSet(false, true)) {
|
||||
SPAN_CLEANER.pendingTraces.remove(this);
|
||||
// preserve throughput count.
|
||||
// Don't report the trace because the data comes from buggy uses of the api and is suspect.
|
||||
tracer.incrementTraceCount();
|
||||
|
|
|
@ -121,6 +121,7 @@ class PendingTraceTest extends Specification {
|
|||
trace.asList() == [rootSpan]
|
||||
writer == []
|
||||
traceCount.get() == 1
|
||||
!PendingTrace.SPAN_CLEANER.pendingTraces.contains(trace)
|
||||
}
|
||||
|
||||
def "add unfinished span to trace fails"() {
|
||||
|
|
Loading…
Reference in New Issue