aboutsummaryrefslogtreecommitdiff
path: root/src/encoding
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2014-10-27 08:46:18 -0700
committerIan Lance Taylor <iant@golang.org>2014-10-27 08:46:18 -0700
commit77595e462be07b8229f88cbdf947e320bfc7e639 (patch)
tree3f60450b01881df43140d21acc8e2825488f2415 /src/encoding
parent78082dfa801d484848ac47c04ce3aa9805d2b0c9 (diff)
downloadgo-77595e462be07b8229f88cbdf947e320bfc7e639.tar.xz
net: if a DNS lookup times out, forget that it is in flight
Before this CL, if the system resolver does a very slow DNS lookup for a particular host, all subsequent requests for that host will hang waiting for that lookup to complete. That is more or less expected when Dial is called with no deadline. When Dial has a deadline, though, we can accumulate a large number of goroutines waiting for that slow DNS lookup. Try to avoid this problem by restarting the DNS lookup when it is redone after a deadline is passed. This CL also avoids creating an extra goroutine purely to handle the deadline. No test because we would have to simulate a slow DNS lookup followed by a fast DNS lookup. Fixes #8602. LGTM=bradfitz R=bradfitz, mikioh.mikioh CC=golang-codereviews, r, rsc https://golang.org/cl/154610044
Diffstat (limited to 'src/encoding')
0 files changed, 0 insertions, 0 deletions