Skip to content

Commit 870a4fd

Browse files
authored
compression-eligible span must not be buffered on an already ended parent (#2576)
1 parent 4eafe5f commit 870a4fd

File tree

1 file changed

+1
-1
lines changed
  • apm-agent-core/src/main/java/co/elastic/apm/agent/impl/transaction

1 file changed

+1
-1
lines changed

apm-agent-core/src/main/java/co/elastic/apm/agent/impl/transaction/Span.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public void beforeEnd(long epochMicros) {
270270
protected void afterEnd() {
271271
if (transaction != null && transaction.isSpanCompressionEnabled() && parent != null) {
272272
Span buffered = parent.bufferedSpan.get();
273-
if (!isCompressionEligible()) {
273+
if (parent.isFinished() || !isCompressionEligible()) {
274274
if (buffered != null) {
275275
if (parent.bufferedSpan.compareAndSet(buffered, null)) {
276276
this.tracer.endSpan(buffered);

0 commit comments

Comments
 (0)