Skip to content

Commit

Permalink
- Fix timer channel drain to avoid hanging in go1.23 w/ asynctimerchan=0
Browse files Browse the repository at this point in the history
  • Loading branch information
dany74q committed Oct 3, 2024
1 parent be328ac commit 978fedc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
- 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 with asynctimerchan=0 (#5868)

<!-- Released section -->
<!-- Don't change this section unless doing release -->
Expand Down
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 978fedc

Please sign in to comment.