• Brad Fitzpatrick's avatar
    net/http: make Transport use new connection if over HTTP/2 concurrency limit · 7a622740
    Brad Fitzpatrick authored
    The Go HTTP/1 client will make as many new TCP connections as the user requests.
    
    The HTTP/2 client tried to have that behavior, but the policy of
    whether a connection is re-usable didn't take into account the extra 1
    stream counting against SETTINGS_MAX_CONCURRENT_STREAMS so in practice
    users were getting errors.
    
    For example, if the server's advertised max concurrent streams is 100
    and 200 concurrrent Go HTTP requests ask for a connection at once, all
    200 will think they can reuse that TCP connection, but then 100 will
    fail later when the number of concurrent streams exceeds 100.
    
    Instead, recognize the "no cached connections" error value in the
    shouldRetryRequest method, so those 100 will retry a new connection.
    
    This is the conservative fix for Go 1.7 so users don't get errors, and
    to match the HTTP/1 behavior. Issues #13957 and #13774 are the more
    involved bugs for Go 1.8.
    
    Updates #16582
    Updates #13957
    
    Change-Id: I1f15a7ce60c07a4baebca87675836d6fe03993e8
    Reviewed-on: https://go-review.googlesource.com/25580
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    Reviewed-by: 's avatarChris Broadfoot <cbro@golang.org>
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    7a622740
Name
Last commit
Last update
..
archive Loading commit data...
bufio Loading commit data...
builtin Loading commit data...
bytes Loading commit data...
cmd Loading commit data...
compress Loading commit data...
container Loading commit data...
context Loading commit data...
crypto Loading commit data...
database/sql Loading commit data...
debug Loading commit data...
encoding Loading commit data...
errors Loading commit data...
expvar Loading commit data...
flag Loading commit data...
fmt Loading commit data...
go Loading commit data...
hash Loading commit data...
html Loading commit data...
image Loading commit data...
index/suffixarray Loading commit data...
internal Loading commit data...
io Loading commit data...
log Loading commit data...
math Loading commit data...
mime Loading commit data...
net Loading commit data...
os Loading commit data...
path Loading commit data...
reflect Loading commit data...
regexp Loading commit data...
runtime Loading commit data...
sort Loading commit data...
strconv Loading commit data...
strings Loading commit data...
sync Loading commit data...
syscall Loading commit data...
testing Loading commit data...
text Loading commit data...
time Loading commit data...
unicode Loading commit data...
unsafe Loading commit data...
vendor/golang_org/x/net Loading commit data...
Make.dist Loading commit data...
all.bash Loading commit data...
all.bat Loading commit data...
all.rc Loading commit data...
androidtest.bash Loading commit data...
bootstrap.bash Loading commit data...
buildall.bash Loading commit data...
clean.bash Loading commit data...
clean.bat Loading commit data...
clean.rc Loading commit data...
cmp.bash Loading commit data...
iostest.bash Loading commit data...
make.bash Loading commit data...
make.bat Loading commit data...
make.rc Loading commit data...
naclmake.bash Loading commit data...
nacltest.bash Loading commit data...
race.bash Loading commit data...
race.bat Loading commit data...
run.bash Loading commit data...
run.bat Loading commit data...
run.rc Loading commit data...