-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
net/http: make Server.SetKeepAlivesEnabled(false) drop currently-open connections #9478
Comments
Too late for Go 1.5. |
Related: #4674 |
Any plan on fixing this? |
@bradfitz, too late for Go 1.8, yes? |
A couple of the other issues might make this easy. I'll close this at the end of the week if it doesn't happen, but let's keep it open until then. |
CL https://golang.org/cl/32329 mentions this issue. |
I'm going to reopen this. The solution I have now is okay, but it's not great. It closes all currently-idle conns, but it should mark all conns for death as soon as they become idle. (For both http1 and http2). I was thinking this before, but the flaky #17754 really drove it home. |
CL https://golang.org/cl/32587 mentions this issue. |
Fixes #17754 Updates #9478 (details in here) Change-Id: Iae2c1ca05a18ed266b53b2594c22fc57fab33c5e Reviewed-on: https://go-review.googlesource.com/32587 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
CL https://golang.org/cl/33141 mentions this issue. |
When adjusting the firewall configuration on a GCE instance today, I was confused that I could toggle my new firewall rule and see the changes immediately affect my ability to telnet to the http server, but my browser continued to work fine, regardless of the firewall setting.
What I realized (too slowly) was happening was that once the keep-alive connection was open, the firewall permitted it forever, as designed and documented.
It would be nice of the
google.golang.org/cloud/compute/metadata
package or similar could listen for metadata changes (the GCE metadata service supports long polling on changes) to see when the firewall or tags change, and then callServer.SetKeepAlivesEnabled(false)
to drop existing connections and force them to (try) to reconnect.Currently Server.SetKeepAlivesEnabled only affects future connections and not active idle ones.
The text was updated successfully, but these errors were encountered: