Skip to content

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
liaoxin01:pick-pr-61197-to-branch-4.0
Open

branch-4.0: [fix](http) Fix jetty_server_max_http_header_size not applied in Jetty 12 (#61197)#61903
liaoxin01 wants to merge 1 commit intoapache:branch-4.0from
liaoxin01:pick-pr-61197-to-branch-4.0

Conversation

@liaoxin01
Copy link
Copy Markdown
Contributor

Pick #61197

…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
@liaoxin01 liaoxin01 requested a review from yiguolei as a code owner March 30, 2026 14:22
Copilot AI review requested due to automatic review settings March 30, 2026 14:22
@Thearas
Copy link
Copy Markdown
Contributor

Thearas commented Mar 30, 2026

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_size via HttpConfiguration#setRequestHeaderSize.
  • Add a regression test that sends a ~100KB HTTP request header to /api/health and 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.

@liaoxin01
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 80.00% (8/10) 🎉
Increment coverage report
Complete coverage report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants