From f0a5c9cb09725fc59c340273a2f56260939986f8 Mon Sep 17 00:00:00 2001 From: dany74q Date: Thu, 3 Oct 2024 08:10:42 +0300 Subject: [PATCH] #5868 - Fix timer channel drain to avoid hanging in go1.23 - Fix timer channel drain to avoid hanging in go1.23 w/ asynctimerchan=0 --- sdk/trace/batch_span_processor.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sdk/trace/batch_span_processor.go b/sdk/trace/batch_span_processor.go index 1d399a75db2..bc301b5a1eb 100644 --- a/sdk/trace/batch_span_processor.go +++ b/sdk/trace/batch_span_processor.go @@ -316,7 +316,10 @@ func (bsp *batchSpanProcessor) processQueue() { bsp.batchMutex.Unlock() if shouldExport { if !bsp.timer.Stop() { - <-bsp.timer.C + select { + case <-bsp.timer.C: + default: + } } if err := bsp.exportSpans(ctx); err != nil { otel.Handle(err)