-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid int overflow when receive large
MAX_CONCURRENT_STREAMS
value (#…
…2572) Motivation: RFC defines that settings values are represented as unsigned 32-bit numbers: https://datatracker.ietf.org/doc/html/rfc9113#section-6.5.1 Since it doesn't explicitly describe any additional restrictions for `SETTINGS_MAX_CONCURRENT_STREAMS` value, it can be as high as 4,294,967,295. When this happens, our concurrency controller receives `-1` and it forces the LB to create a new connection for every HTTP/2 request. Modifications: - `H2ClientParentConnectionContext` should adjust high `maxConcurrentStreams` values to `Integer.MAX_VALUE`. This is an equivalent of unbounded concurrency. Netty's `DefaultHttp2ConnectionDecoder` and `DefaultHttp2ConnectionEncoder` do the same. - Add a reproducer; Result: Large `SETTINGS_MAX_CONCURRENT_STREAMS` values adjusted to `Integer.MAX_VALUE`.
- Loading branch information
1 parent
825f235
commit 6da8c12
Showing
4 changed files
with
49 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters