Skip to content

[fix](http) Fix jetty_server_max_http_header_size not applied in Jetty 12#61197

Merged
liaoxin01 merged 2 commits intoapache:masterfrom
liaoxin01:worktree-fix-jetty-header-size
Mar 13, 2026
Merged

[fix](http) Fix jetty_server_max_http_header_size not applied in Jetty 12#61197
liaoxin01 merged 2 commits intoapache:masterfrom
liaoxin01:worktree-fix-jetty-header-size

Conversation

@liaoxin01
Copy link
Contributor

@liaoxin01 liaoxin01 commented Mar 10, 2026

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_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).

Root Cause

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.

Solution

Explicitly set requestHeaderSize on all server connectors in WebServerFactoryCustomizerConfig by adding a server customizer that configures the HttpConfiguration for each connector.

Testing

  • 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

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]>
Copilot AI review requested due to automatic review settings March 10, 2026 16:03
@hello-stephen
Copy link
Contributor

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?

Add test to verify that large HTTP headers (100KB) are properly handled
after fixing jetty_server_max_http_header_size configuration.
@liaoxin01 liaoxin01 force-pushed the worktree-fix-jetty-header-size branch from afae2eb to 7ca4f82 Compare March 10, 2026 16:05
@liaoxin01
Copy link
Contributor Author

run buildall

Copy link

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

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 requestHeaderSize to each Jetty connector’s HttpConfiguration via 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.

@doris-robot
Copy link

TPC-H: Total hot run time: 27894 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 7ca4f8244f44f6a439e951aef9760af42b9c4694, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17700	4525	4321	4321
q2	q3	10649	816	503	503
q4	4679	373	257	257
q5	7548	1180	1012	1012
q6	183	184	148	148
q7	807	844	664	664
q8	9452	1483	1382	1382
q9	4972	4770	4757	4757
q10	6351	1911	1685	1685
q11	468	276	235	235
q12	757	571	464	464
q13	18035	2936	2190	2190
q14	233	225	211	211
q15	939	797	825	797
q16	760	742	674	674
q17	735	888	436	436
q18	6194	5309	5225	5225
q19	1111	1013	645	645
q20	511	502	395	395
q21	4516	2241	1564	1564
q22	436	339	329	329
Total cold run time: 97036 ms
Total hot run time: 27894 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4641	4537	4583	4537
q2	q3	3895	4305	3855	3855
q4	910	1196	807	807
q5	4059	4454	4381	4381
q6	195	191	149	149
q7	1784	1657	1583	1583
q8	2464	2694	2570	2570
q9	7536	7471	7448	7448
q10	3738	4045	3627	3627
q11	527	474	416	416
q12	511	609	448	448
q13	2691	3308	2352	2352
q14	305	306	286	286
q15	909	853	827	827
q16	716	763	720	720
q17	1213	1444	1414	1414
q18	7268	6848	6723	6723
q19	960	938	980	938
q20	2083	2163	2044	2044
q21	3937	3432	3369	3369
q22	507	425	404	404
Total cold run time: 50849 ms
Total hot run time: 48898 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 153673 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 7ca4f8244f44f6a439e951aef9760af42b9c4694, data reload: false

query5	4331	650	530	530
query6	334	239	205	205
query7	4220	476	266	266
query8	341	271	237	237
query9	8697	2760	2714	2714
query10	538	404	336	336
query11	7314	5860	5638	5638
query12	198	132	131	131
query13	1272	475	360	360
query14	5780	3844	3612	3612
query14_1	2845	2831	2804	2804
query15	202	192	176	176
query16	994	486	457	457
query17	1120	718	621	621
query18	2444	454	357	357
query19	219	216	192	192
query20	138	136	126	126
query21	229	141	125	125
query22	5018	5084	4882	4882
query23	15947	15532	15444	15444
query23_1	15518	16274	15846	15846
query24	7317	1702	1300	1300
query24_1	1273	1296	1280	1280
query25	669	519	491	491
query26	898	297	184	184
query27	3135	511	326	326
query28	5341	1954	2035	1954
query29	985	720	499	499
query30	316	255	218	218
query31	1413	1382	1307	1307
query32	94	81	86	81
query33	573	344	304	304
query34	959	973	589	589
query35	681	691	630	630
query36	1127	1118	963	963
query37	137	94	84	84
query38	2939	2942	2901	2901
query39	892	870	865	865
query39_1	827	814	823	814
query40	232	152	137	137
query41	67	61	60	60
query42	312	300	306	300
query43	262	259	221	221
query44	
query45	200	192	184	184
query46	902	988	603	603
query47	2133	2125	2083	2083
query48	315	366	242	242
query49	608	484	386	386
query50	700	291	222	222
query51	4116	4091	4124	4091
query52	292	298	287	287
query53	297	339	284	284
query54	310	278	271	271
query55	94	89	85	85
query56	331	330	326	326
query57	1366	1345	1322	1322
query58	293	280	281	280
query59	1359	1443	1293	1293
query60	351	354	333	333
query61	149	140	147	140
query62	626	590	530	530
query63	309	283	279	279
query64	4548	1271	1004	1004
query65	
query66	1397	453	357	357
query67	16434	16491	16311	16311
query68	
query69	388	319	312	312
query70	956	987	909	909
query71	360	312	306	306
query72	2712	2804	2462	2462
query73	559	568	315	315
query74	10090	9956	9778	9778
query75	2867	2717	2465	2465
query76	2295	1050	698	698
query77	366	394	315	315
query78	11042	11249	10646	10646
query79	2777	836	608	608
query80	1626	626	544	544
query81	592	282	243	243
query82	503	150	118	118
query83	364	277	239	239
query84	247	118	98	98
query85	905	490	447	447
query86	477	341	296	296
query87	3156	3086	3016	3016
query88	3593	2658	2664	2658
query89	429	373	358	358
query90	2255	179	182	179
query91	171	161	140	140
query92	93	78	71	71
query93	1970	844	499	499
query94	644	333	289	289
query95	609	397	319	319
query96	640	537	228	228
query97	2424	2472	2398	2398
query98	252	220	221	220
query99	997	997	940	940
Total cold run time: 236417 ms
Total hot run time: 153673 ms

Copy link
Contributor

@dataroaring dataroaring left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions github-actions bot added approved Indicates a PR has been approved by one committer. reviewed labels Mar 11, 2026
@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

Copy link
Contributor

@sollhui sollhui left a comment

Choose a reason for hiding this comment

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

LGTM

@liaoxin01 liaoxin01 merged commit a6043b5 into apache:master Mar 13, 2026
32 of 35 checks passed
@liaoxin01 liaoxin01 deleted the worktree-fix-jetty-header-size branch March 13, 2026 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/4.0.x dev/4.0.x-conflict dev/4.1.x reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants