You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-07-13 01:00:22 +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:
@ -27,6 +27,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|||||||
|
|
||||||
- The race condition for multiple `FixedSize` exemplar reservoirs identified in #5814 is resolved. (#5819)
|
- The race condition for multiple `FixedSize` exemplar reservoirs identified in #5814 is resolved. (#5819)
|
||||||
- Fix log records duplication in case of heterogeneous resource attributes by correctly mapping each log record to it's resource and scope. (#5803)
|
- Fix log records duplication in case of heterogeneous resource attributes by correctly mapping each log record to it's resource and scope. (#5803)
|
||||||
|
- Fix timer channel drain to avoid hanging on Go 1.23. (#5868)
|
||||||
|
|
||||||
<!-- Released section -->
|
<!-- Released section -->
|
||||||
<!-- Don't change this section unless doing release -->
|
<!-- Don't change this section unless doing release -->
|
||||||
|
@ -316,7 +316,11 @@ func (bsp *batchSpanProcessor) processQueue() {
|
|||||||
bsp.batchMutex.Unlock()
|
bsp.batchMutex.Unlock()
|
||||||
if shouldExport {
|
if shouldExport {
|
||||||
if !bsp.timer.Stop() {
|
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 {
|
if err := bsp.exportSpans(ctx); err != nil {
|
||||||
otel.Handle(err)
|
otel.Handle(err)
|
||||||
|
Reference in New Issue
Block a user