Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: data race with uninstallTestHooks #21090

Closed
aclements opened this issue Jul 19, 2017 · 5 comments
Closed

net: data race with uninstallTestHooks #21090

aclements opened this issue Jul 19, 2017 · 5 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@aclements
Copy link
Member

A race between net.uninstallTestHooks and internal/poll.(*FD).destroy() on linux-amd64-race has appeared on the dashboard a few times:

2017-06-25T15:57:18-b4dd1d9/linux-amd64-race
2017-07-10T20:09:00-6f83b75/linux-amd64-race
2017-07-15T20:44:10-0b62ebf/linux-amd64-race
2017-07-15T20:49:42-7390d2f/linux-amd64-race

And just appeared on a trybot: https://go-review.googlesource.com/c/50030/

@aclements aclements added the Testing An issue that has been verified to require only test changes, not just a test failure. label Jul 19, 2017
@bradfitz
Copy link
Contributor

/cc @mikioh @ianlancetaylor

@bradfitz bradfitz added the NeedsFix The path to resolution is known, but the work has not been done. label Jul 19, 2017
@bradfitz bradfitz added this to the Go1.10 milestone Jul 19, 2017
@ianlancetaylor
Copy link
Contributor

Seems like the problem is that a cancelled DNS lookup can leave behind a goroutine that has a deferred close of a DNS connection (the defer c.Close() in (*Resolver).exchange). There is no synchronization between that deferred close and the call to uninstallTestHooks in TestMain. uninstallTestHooks changes poll.CloseFunc, which is called when closing a connection. Ideally we should wait for all goroutines to complete before uninstalling the test hook, but at present there is no obvious way to do that.

@josharian
Copy link
Contributor

@bradfitz
Copy link
Contributor

@gopherbot
Copy link

Change https://golang.org/cl/82795 mentions this issue: net: avoid race on test hooks with DNS goroutines

@golang golang locked and limited conversation to collaborators Dec 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

5 participants