[fix](http) Fix jetty_server_max_http_header_size not applied in Jetty 12#61197
Merged
liaoxin01 merged 2 commits intoapache:masterfrom Mar 13, 2026
Merged
Conversation
In Jetty 12 + Spring Boot 3, the server.max-http-header-size property is not automatically applied to custom HttpConfiguration objects. This causes HTTP 431 errors when header size exceeds the default 8KB. This fix explicitly sets requestHeaderSize on all connectors to ensure the configuration is properly applied. Fixes: CIR-19619 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Add test to verify that large HTTP headers (100KB) are properly handled after fixing jetty_server_max_http_header_size configuration.
afae2eb to
7ca4f82
Compare
Contributor
Author
|
run buildall |
There was a problem hiding this comment.
Pull request overview
Fixes Jetty 12/Spring Boot 3 behavior where jetty_server_max_http_header_size was not being applied, causing HTTP 431 errors for large request headers.
Changes:
- Apply
requestHeaderSizeto each Jetty connector’sHttpConfigurationvia a server customizer. - Add a regression test that sends a 100KB request header to verify large headers are accepted.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| regression-test/suites/http_p0/test_large_http_header.groovy | Adds regression coverage for large request headers (expects non-431). |
| fe/fe-core/src/main/java/org/apache/doris/httpv2/config/WebServerFactoryCustomizerConfig.java | Ensures Jetty connectors inherit configured max request header size under Jetty 12. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fe/fe-core/src/main/java/org/apache/doris/httpv2/config/WebServerFactoryCustomizerConfig.java
Show resolved
Hide resolved
TPC-H: Total hot run time: 27894 ms |
TPC-DS: Total hot run time: 153673 ms |
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
HTTP 431 "Request Header Fields Too Large" error occurs when sending requests with large headers (>8KB) to FE, even though
jetty_server_max_http_header_sizeis configured to 10MB.This issue appears in cloud-4.1.2 (Jetty 12 + Spring Boot 3) but not in cloud-4.0.10 (Jetty 9 + Spring Boot 2).
Root Cause
In Jetty 12 with Spring Boot 3, the
server.max-http-header-sizeproperty does not automatically apply to customHttpConfigurationobjects created inWebServerFactoryCustomizer. The default 8KB limit remains in effect.Solution
Explicitly set
requestHeaderSizeon all server connectors inWebServerFactoryCustomizerConfigby adding a server customizer that configures theHttpConfigurationfor each connector.Testing
test_large_http_header.groovythat verifies 100KB headers are accepted