branch-4.0: [fix](http) Fix jetty_server_max_http_header_size not applied in Jetty 12 (#61197)#61903
Open
liaoxin01 wants to merge 1 commit intoapache:branch-4.0from
Open
branch-4.0: [fix](http) Fix jetty_server_max_http_header_size not applied in Jetty 12 (#61197)#61903liaoxin01 wants to merge 1 commit intoapache:branch-4.0from
liaoxin01 wants to merge 1 commit intoapache:branch-4.0from
Conversation
…y 12 (apache#61197) 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_size` is 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). In Jetty 12 with Spring Boot 3, the `server.max-http-header-size` property does not automatically apply to custom `HttpConfiguration` objects created in `WebServerFactoryCustomizer`. The default 8KB limit remains in effect. Explicitly set `requestHeaderSize` on all server connectors in `WebServerFactoryCustomizerConfig` by adding a server customizer that configures the `HttpConfiguration` for each connector. - Added regression test `test_large_http_header.groovy` that verifies 100KB headers are accepted - Verified before fix: HTTP 431 error with large headers - Verified after fix: HTTP 200 success with large headers
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR backports a fix to ensure jetty_server_max_http_header_size is actually applied when running FE HTTP service on Jetty 12, and adds a regression test to validate large request headers are accepted.
Changes:
- Customize Jetty connectors to apply
Config.jetty_server_max_http_header_sizeviaHttpConfiguration#setRequestHeaderSize. - Add a regression test that sends a ~100KB HTTP request header to
/api/healthand verifies it doesn’t fail with 431.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
fe/fe-core/src/main/java/org/apache/doris/httpv2/config/WebServerFactoryCustomizerConfig.java |
Applies request header size to existing Jetty connectors via a server customizer. |
regression-test/suites/http_p0/test_large_http_header.groovy |
New regression test exercising large HTTP request headers against FE’s /api/health. |
💡 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
Contributor
Author
|
run buildall |
Contributor
FE UT Coverage ReportIncrement line coverage |
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.
Pick #61197