Fix HTTP2 connections with multiple streams stalling#193
Conversation
HTTP2 knows a stream and connection flow-control window. Both windows need to be respected. A logic was put in place, to not update the window sizes when the stream that sent the data was closed. That's fine. But we do need to update the global window, otherwise the global window size permanently shrinks by that amount. When reusing a connection many times, this shinks the window size down to zero over time, effectively stalling the connection.
28e65f2 to
d98aca1
Compare
|
Cool! |
|
@peelle Are you OK with me giving you a commit bit in the croservices org? - Update: I've sent an invite. |
Thank you for the invite. I've accepted. I'm excited to help y'all out. |
|
Hi folks -- I've been having occasional issues like the one below with recent versions of cro-http: I bisected the changes and ended up at this PR. I'm not sure what the underlying cause is, but commenting out the code that was introduced in this PR resolves the issue. Any ideas? |
|
@bduggan Thanks for digging into this! |
|
This was on the client side. I'll see if I can make a minimal test case or generate a trace log. |
|
okay, here's a minimal test case and trace log -> #203 |
This has a specific meaning that may not be intended see croservices#193 https://medium.com/coderscorner/http-2-flow-control-77e54f7fd518 WINDOW_UPDATE frame with a value 0 results in a stream error of type protocol error.
HTTP2 knows a stream and connection flow-control window. Both windows need to be respected. A logic was put in place, to not update the window sizes when the stream that sent the data was closed. That's fine. But we do need to update the global window, otherwise the global window size permanently shrinks by that amount. When reusing a connection many times, this shinks the window size down to zero over time, effectively stalling the connection.