]> Cypherpunks repositories - gostls13.git/commit
net: stop multiple sends into single capacity channel in lookupIP
authorAlex Brainman <alex.brainman@gmail.com>
Sat, 5 May 2018 07:03:21 +0000 (17:03 +1000)
committerAlex Brainman <alex.brainman@gmail.com>
Sat, 12 May 2018 09:27:42 +0000 (09:27 +0000)
commit33b2b172014c50c42597785a60d9e98288fe737c
treed8b99015e2b371cf17a9ad2a1f4b440f780193c0
parentf94b5a81057ccf6d16da3a78b2ff5c08383f9768
net: stop multiple sends into single capacity channel in lookupIP

ch is of size 1, and has only one read. But current code can
write to ch more than once. This makes goroutines that do network
name lookups block forever. Only 500 goroutines are allowed, and
we eventually run out of goroutines.

Rewrite the code to only write into ch once.

Fixes #24178

Change-Id: Ifbd37db377c8b05e69eca24cc9147e7f86f899d8
Reviewed-on: https://go-review.googlesource.com/111718
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/lookup_test.go
src/net/lookup_windows.go