Skip to content

receiver/statsdreceiver: fix data race in shutdown#43002

Merged
songy23 merged 1 commit into
open-telemetry:mainfrom
axw:statsdreceiver-fix-race
Sep 26, 2025
Merged

receiver/statsdreceiver: fix data race in shutdown#43002
songy23 merged 1 commit into
open-telemetry:mainfrom
axw:statsdreceiver-fix-race

Conversation

@axw
Copy link
Copy Markdown
Contributor

@axw axw commented Sep 26, 2025

Description

Simplify the code, and avoid a data race by ensuring that sync.WaitGroup.Add calls always come before the sync.WaitGroup.Wait call by closing the listener first on shutdown.

Link to tracking issue

Fixes #42878

Testing

go test -v -failfast -run Test_Server_ListenAndServe -count=1000 -race

Documentation

N/A

Simplify the code, and avoid a data race by ensuring
that sync.WaitGroup.Add calls always come before the
sync.WaitGroup.Wait call by closing the listener first
on shutdown.

Fixes
open-telemetry#42878
@axw axw requested review from a team and dmitryax as code owners September 26, 2025 03:37
@github-actions github-actions Bot added the receiver/statsd statsd related issues label Sep 26, 2025
@github-actions github-actions Bot requested a review from jmacd September 26, 2025 03:37
@songy23 songy23 merged commit c773379 into open-telemetry:main Sep 26, 2025
188 checks passed
@github-actions github-actions Bot added this to the next release milestone Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

receiver/statsd statsd related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[receiver/statsdreceiver/internal/transport]: Report for failed tests on main

5 participants