You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-07-05 00:28:58 +02:00
Fix timer channel drain to avoid hanging in Go 1.23 (#5869)
- Fix timer channel drain to avoid hanging in go1.23 w/ asynctimerchan=0 (https://github.com/open-telemetry/opentelemetry-go/issues/5868) --------- Co-authored-by: Robert Pająk <pellared@hotmail.com> Co-authored-by: Damien Mathieu <42@dmathieu.com>
This commit is contained in:
@ -316,7 +316,11 @@ func (bsp *batchSpanProcessor) processQueue() {
|
||||
bsp.batchMutex.Unlock()
|
||||
if shouldExport {
|
||||
if !bsp.timer.Stop() {
|
||||
<-bsp.timer.C
|
||||
// Handle both GODEBUG=asynctimerchan=[0|1] properly.
|
||||
select {
|
||||
case <-bsp.timer.C:
|
||||
default:
|
||||
}
|
||||
}
|
||||
if err := bsp.exportSpans(ctx); err != nil {
|
||||
otel.Handle(err)
|
||||
|
Reference in New Issue
Block a user