Skip to content

Fix TSan data race in UDP Socket Tests - #13875

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test/cl954957961
Jul 28, 2026
Merged

Fix TSan data race in UDP Socket Tests#13875
copybara-service[bot] merged 1 commit into
masterfrom
test/cl954957961

Conversation

@copybara-service

Copy link
Copy Markdown

Fix TSan data race in UDP Socket Tests

TSan flags concurrent socket operations on the identical host FD
as a data race. This commit uses dup() to duplicate the socket file
descriptor specifically for the background thread's connect() call,
so sendto and connect can execute concurrently from two different
threads without TSan data race on the fd struct.

@copybara-service copybara-service Bot added the exported Issue was exported automatically label Jul 28, 2026
@copybara-service
copybara-service Bot force-pushed the test/cl954957961 branch 4 times, most recently from 32a883b to 55a7f36 Compare July 28, 2026 21:14
TSan flags concurrent socket operations on the identical host FD
as a data race. This commit uses dup() to duplicate the socket file
descriptor specifically for the background thread's connect() call,
so sendto and connect can execute concurrently from two different
threads without TSan data race on the fd struct.

PiperOrigin-RevId: 955479183
@copybara-service
copybara-service Bot merged commit 87dc2c0 into master Jul 28, 2026
@copybara-service
copybara-service Bot deleted the test/cl954957961 branch July 28, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exported Issue was exported automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant