Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/net/http2: connection reused with DisableKeepAlives #22441

Closed
benburkert opened this issue Oct 25, 2017 · 6 comments
Closed

x/net/http2: connection reused with DisableKeepAlives #22441

benburkert opened this issue Oct 25, 2017 · 6 comments
Assignees
Milestone

Comments

@benburkert
Copy link
Contributor

@benburkert benburkert commented Oct 25, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.9 darwin/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/benburkert"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.9/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.9/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/qs/qkt9twmx4qg379d6f8kxl1vm0000gn/T/go-build568362356=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

Send multiple requests to the same h2 server with keep alives disabled.

https://play.golang.org/p/sxjh2Yq-hg

What did you expect to see?

no output because connections are not used across requests.

What did you see instead?

connection reused: "[::1]:61658"
connection reused: "[::1]:61658"
connection reused: "[::1]:61658"
connection reused: "[::1]:61658"
connection reused: "[::1]:61661"
connection reused: "[::1]:61665"
connection reused: "[::1]:61668"
connection reused: "[::1]:61668"
connection reused: "[::1]:61668"
connection reused: "[::1]:61668"
connection reused: "[::1]:61671"
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Oct 25, 2017

@ianlancetaylor ianlancetaylor added this to the Go1.10 milestone Oct 25, 2017
@tombergan

This comment has been minimized.

Copy link
Contributor

@tombergan tombergan commented Oct 27, 2017

Might be related to #22413

@tombergan

This comment has been minimized.

Copy link
Contributor

@tombergan tombergan commented Oct 27, 2017

https://golang.org/cl/33153 was wrong. When keep alives are disabled, we don't start graceful shutdown (i.e., send GOAWAY) until the first request completes. We should actually start graceful shutdown when the first request is received.

@tombergan tombergan self-assigned this Oct 27, 2017
@tombergan

This comment has been minimized.

Copy link
Contributor

@tombergan tombergan commented Oct 27, 2017

Actually, this is WAI according to https://golang.org/cl/33153:
https://go-review.googlesource.com/c/net/+/33153/1/http2/server.go#1281

I don't think this gets all the cases. What if the client sends a second request before the first completes?

I think that's fine. It's supposed to be close-ish in behavior. I figure that the user's intention was probably to minimize open connections, closing them as soon as possible. So if their goal is to minimize conns, it's better to support reusing one conn for multiple requests.

@benburkert, what are you trying to achieve by disabling keep alives on HTTP/2? This feature happened in #17717 where Brad was trying to give meaning to SetKeepAlivesEnabled for HTTP/2. In all honesty it's kind of weird for the HTTP/2 library to support this option, since "keep alives" are an HTTP/1 notion that doesn't translate to HTTP/2.

@tombergan

This comment has been minimized.

Copy link
Contributor

@tombergan tombergan commented Nov 27, 2017

Removing the 1.10 milestone since there is no bug that I can see. I will leave this open in state WaitingForInfo in case @benburkert wants to respond to the above question.

@tombergan tombergan removed this from the Go1.10 milestone Nov 27, 2017
@bradfitz bradfitz added this to the Unplanned milestone Nov 27, 2017
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 30, 2017

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@gopherbot gopherbot closed this Nov 30, 2017
@golang golang locked and limited conversation to collaborators Nov 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.