Skip to content

Commit

Permalink
#5868 - Fix timer channel drain to avoid hanging in go1.23
Browse files Browse the repository at this point in the history
- Fix timer channel drain to avoid hanging in go1.23 w/ asynctimerchan=0
  • Loading branch information
dany74q committed Oct 3, 2024
1 parent be328ac commit f0a5c9c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sdk/trace/batch_span_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f0a5c9c

Please sign in to comment.