Skip to content
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

Allow headers size extend to maxRequestHeadersSize in http client #12436

Closed
shaoxt opened this issue Oct 29, 2024 · 0 comments · Fixed by #12544
Closed

Allow headers size extend to maxRequestHeadersSize in http client #12436

shaoxt opened this issue Oct 29, 2024 · 0 comments · Fixed by #12544

Comments

@shaoxt
Copy link
Contributor

shaoxt commented Oct 29, 2024

Jetty version(s)
Jetty Version 10-12

Enhancement Description

In HttpSenderOverHTTP and HttpClient, there is a "headerBuffer" which allocated by the "httpclient.getRequestBufferSize".
If the buffer overflowed, there will be an IllegalArgumentException("Request header too large"). To support higher headers, for examples 32K or 64K, has to set the request buffer size higher accordingly right now.

But 99% use cases, we don't need such high headerBuffer. Also when backend connections stuck, these high buffer will bump up the memory consumption significantly.

The enhancement will be have a new limit for headers, it will be "httpclient.maxRequestHeadersSize". The headerBuffer still starts will the "httpclient.getRequestBufferSize". While the headerBuffer runs into overflow state. The headerBuffer will be allocated as "httpclient.maxRequestHeadersSize", and continue the flow.

In this case, 99% use cases can be covered by smaller header buffer, and 1% cases run into buffer extension.

sbordet added a commit that referenced this issue Nov 15, 2024
…http client.

Reworked contribution by @shaoxt in light of the work done in #12351.

Signed-off-by: Simone Bordet <[email protected]>
@sbordet sbordet moved this to 🏗 In progress in Jetty 12.1.0 Nov 15, 2024
sbordet added a commit that referenced this issue Nov 17, 2024
…http client.

Reworked contribution by @shaoxt in light of the work done in #12351.

Signed-off-by: Simone Bordet <[email protected]>
@sbordet sbordet moved this from 🏗 In progress to ✅ Done in Jetty 12.1.0 Nov 17, 2024
@sbordet sbordet closed this as completed Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
2 participants