-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
HTTP/2 max local stream count exceeded #6208
Comments
Cannot reproduce. I see Jetty's client sending requests, and Tomcat server replying to some but then stopping to reply, so the client times out. I suggest you change the server to Jetty (SpringBoot supports Jetty too) and see if you still have problems. |
Maybe your computer is stronger than mine, I increase the thread size, please try it again and please use the client code provided in the repo directly. Its path is "jetty9-client-sample/src/main/java/org/sample/jetty/client/http2/HttpClientWithHttp2Transport.java". The problem must be reproduced. And please refer to the log on my side. https://github.com/qingdaoheze/jetty-gzip-decode/blob/master/detail.log.tar.gz |
As I said, I cannot reproduce. Your logs show nothing wrong in Jetty. The timeouts you see are only due to the (bad) load test that overwhelms the client and the server and eventually the client times out. |
I only uploaded the first part of the log because the whole log is too big. I have re-run and uploaded more logs, please check again. In my case, this question certainly comes up. https://github.com/qingdaoheze/jetty-gzip-decode/blob/master/detail.log.tar.gz The first timeout is between 09:05:45.244 and 09:05:50.220. At 09:06:26.269, the first java.lang.IllegalStateException: Max local stream count 100 exceeded. |
Dear @sbordet, We also encountered similar issues. Is there any difference between Jetty server and tomcat server regarding HTTP2.0 implementation? Really appreciate ur great help in advance~ Thanks, |
@sbordet |
Yes the implementations are completely different. |
@lsc1943 if you use Jetty's low-level The line of logging that you chose is perfectly normal, and the states that you see are correct. I need evidence that there is a Jetty issue. Take into account that Jetty's HTTP/2 implementation has been quite battle tested; you may have found an issue, but chances are that either it's a bug in your code, or in the server's code. |
@sbordet, thank you for your help. We are using the high-level HttpClient and we checked the debug log but didn't observe any abnormals, it seems the HEADER frames were sent to server but got no response util timeout. |
They are not relevant. There is some evidence that I am investigating in @qingdaoheze logs. Stay tuned for updates. |
@sbordet I have rerun the demo with full DEBUG logging in (org.eclipse.jetty). Please refer to it: |
@qingdaoheze we have reproduced the issue and found the bug, it's a quite particular combination of many things that must go wrong. I'll write a report when we have a test case and the fix. |
Do you know what workaround can I use before you fix it? @sbordet BTW, when will you fix it? |
There is no workaround. The fix is underway. |
Backported from Jetty 10 the "new stream" event so that the Stream can be set early on the client's `HttpChannelOverHTTP2`. In this way, when a HEADERS frame stalled due to TCP congestion is failed, the corresponding Stream is closed and the connection released to the pool, fixing the "max stream exceeded" issue. Signed-off-by: Simone Bordet <[email protected]>
FTR, here is what is happening. The big HEADERS frames, load test being written as it is and the server being overwhelmed caused a connection to TCP congest. At that point, a HEADERS frame is sent by the client, queued into the The corresponding request times out and the failure arrives at This causes a @qingdaoheze can you build Jetty from branch |
Updates after review. Signed-off-by: Simone Bordet <[email protected]>
@sbordet I have verified it, it worked fine. Thank you! I will do more verification, if I have any other found, I will tell you. |
* Fixes #6208 - HTTP/2 max local stream count exceeded Backported from Jetty 10 the "new stream" event so that the Stream can be set early on the client's `HttpChannelOverHTTP2`. In this way, when a HEADERS frame stalled due to TCP congestion is failed, the corresponding Stream is closed and the connection released to the pool, fixing the "max stream exceeded" issue. Signed-off-by: Simone Bordet <[email protected]>
Forward port of #6220 from jetty-9.4.x to jetty-10.0.x. Signed-off-by: Simone Bordet <[email protected]> (cherry-picked from commit 2f19c67)
Forward port of #6220 from jetty-9.4.x to jetty-10.0.x. Signed-off-by: Simone Bordet <[email protected]> (cherry-picked from commit 2f19c67)
Jetty version
9.4.39.v20210325
Java version
1.8
OS type/version
MAC and linux
Description
When the header size reaches some value (In my demo, it's 2237B) and multiple requests send concurrently, some requests will not be sent to remote server and cause an TimeoutException and then an "java.lang.IllegalStateException: Max local stream count 100 exceeded". When the header size is smaller, it's ok. Please refer to this demo project to reproduce it.
https://github.com/qingdaoheze/jetty-gzip-decode
@sbordet
The text was updated successfully, but these errors were encountered: