• Ian Lance Taylor's avatar
    net: if a DNS lookup times out, forget that it is in flight · 77595e46
    Ian Lance Taylor authored
    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
    77595e46
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...