]> Cypherpunks repositories - gostls13.git/commit
net: fix deadlock in lookupProtocol on Windows
authorSpike Curtis <spike@coder.com>
Thu, 17 Apr 2025 06:55:10 +0000 (06:55 +0000)
committerQuim Muntal <quimmuntal@gmail.com>
Mon, 12 May 2025 19:27:33 +0000 (12:27 -0700)
commit18431a1c8f7d19410fcd3fe6638cfe1cd4bd7179
treecf31f82f5f90a6cf4bba95c36b41f54ec6077341
parent41bd52b3fa2ac77e0180f29777309f65fda9fad0
net: fix deadlock in lookupProtocol on Windows

If the context expires before acquireThread(ctx) succeeds, then the goroutine can block like:

net.lookupProtocol.func1()
src/net/lookup_windows.go:58 +0x105
created by net.lookupProtocol in goroutine 2834
src/net/lookup_windows.go:56 +0xda

We saw this in our UTs with a leak detector, confirmed by inspection of the source code.

Change-Id: I9b927f0345a2fa7336b23d95c506a8a0976e28d0
GitHub-Last-Rev: 27af7477a99bdbee0c32697837f1ff261ee70d83
GitHub-Pull-Request: golang/go#73364
Reviewed-on: https://go-review.googlesource.com/c/go/+/664956
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Zxilly Chou <zhouxinyu1001@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/net/lookup_windows.go