question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support graceful connection close

See original GitHub issue

RFC 7540 section 6.8 seems to indicate that traffic can continue flowing in both directions after a GOAWAY frame, with the only restriction being that the recipient can’t open new streams after receiving the GOAWAY:

   A GOAWAY frame might not immediately precede closing of the
   connection; a receiver of a GOAWAY that has no more use for the
   connection SHOULD still send a GOAWAY frame before terminating the
   connection.
...
   Activity on streams numbered lower or equal to the last stream
   identifier might still complete successfully.  The sender of a GOAWAY
   frame might gracefully shut down a connection by sending a GOAWAY
   frame, maintaining the connection in an "open" state until all in-
   progress streams complete.

But, h2’s connection state machine immediately transitions to CLOSED upon sending or receiving a GOAWAY, effectively prohibiting any further traffic. Would you be interested in a patch to fix this, or is there some disconnect I’m missing between the wording of the RFC and actual implementations?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:4
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
ech0-pycommented, Mar 8, 2021

+1 on this issue Since such software like HAProxy terminates connections by sending GOAWAY first and HEADERS/DATA frames right after - the current transition states are unable to handle this. Wireshark_vtA0SONNpX

3reactions
stephenc-pacecommented, Nov 18, 2022

Any updates on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support graceful connection close · Issue #1181 - GitHub
RFC 7540 section 6.8 seems to indicate that traffic can continue flowing in both directions after a GOAWAY frame, with the only restriction ......
Read more >
Graceful Shutdown, Linger Options, and Socket Closure
In a graceful shutdown sequence, any data that has been queued, but not yet transmitted can be sent prior to the connection being...
Read more >
How do you close TCP connections gracefully without ...
Use Socket.Shutdown() before calling Socket.Close(). Wait for shutdown processing to complete (e.g. ReceiveAsync() will return 0 bytes).
Read more >
Graceful HTTP Server Shutdown with Keep-Alive Connections
What's the best way to gracefully shutdown a node HTTP server, with keep alive connections? I'm calling server.close(), which stops accepting new ...
Read more >
Re: [jetty-users] Graceful shutdown for custom connections
Some components just switch to a different mode - ie responses are now sent with Connection:close so connections are not persistent, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found