Clean up the HTTP/2 client SETTINGS code that has no effect, and make the client's SETTINGS values configurable
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- java
- Domain
- backend, networking, testing
Research direction
Start with HTTP2JettyClient property loading and the CustomHTTP2ClientConnectionFactory.onOpen() code that builds the client SETTINGS frame; trace how h2 over TLS and both h2c modes configure their clients. Then inspect the README property table and docs/http-debug-notes.md. Done means the configured settings and h2c header agree across all three modes, defaults remain compatible, and the acceptance capture tests pass.
Written by the indexing model from the issue text.
Description
Related: #41
Background
HTTP2JettyClient has a block labelled "Experimental HTTP/2 SETTINGS frame configuration" with these fields:
settingsHeaderTableSizesettingsMaxConcurrentStreamssettingsInitialWindowSizesettingsMaxFrameSizesettingsMaxHeaderListSizedisableServerPush
It applies them to Jetty's HTTP2Client through reflection, guarded by hasMethod. On Jetty 12 (12.1.11), HTTP2Client has no setInitialStreamWindowSize, setMaxConcurrentStreams, setMaxHeaderListSize or setHeaderTableSize method. hasMethod therefore skips those calls without any error. The only call that runs is setMaxFrameSize(16384), which is already Jetty's default.
The client's SETTINGS frame is built by CustomHTTP2ClientConnectionFactory from HTTP2Client getters, so none of these fields reaches it.
Problems found
- The fields have no effect on the SETTINGS frame sent over TLS (h2).
- The h2c upgrade disagrees with the real frame.
buildH2cSettingsHeaderValue()builds theHTTP2-Settingsheader of the h2c upgrade request from these fields. The SETTINGS frame sent after the upgrade uses different values:INITIAL_WINDOW_SIZEis 65535 in the header and 8388608 in the frame.MAX_HEADER_LIST_SIZEis 4096 in the header and is not sent in the frame. Since the frame does not override it, the server keeps 4096 from the header.
blazemeter.http.settingsMaxHeaderListSizedoes not do what the README says. The README describes it as HTTP/2SETTINGS_MAX_HEADER_LIST_SIZE. It is only used in the h2c upgrade header and in a warning that never fires (see 4).- The listener that should log the server's SETTINGS never runs. It is registered by reflection through
HTTP2Client.addSessionListener, which does not exist in Jetty 12. So the received SETTINGS are never logged, and the warning about the server'sSETTINGS_MAX_HEADER_LIST_SIZEnever fires. That warning also compares against the wrong value: the server'sMAX_HEADER_LIST_SIZElimits the client's request headers, not its response headers. blazemeter.http.skipHttp2Settingsdoes nothing. It is documented indocs/http-debug-notes.md, but it only skips thesetMaxFrameSize(16384)call, which changes nothing.disableServerPushcannot be turned on. No property sets it, so it is alwaysfalseand its branches never run.
What Jetty 12 lets us configure
The client's SETTINGS frame is built in our own CustomHTTP2ClientConnectionFactory.onOpen(). Each parameter maps to a public HTTP2Client setter, or can be added there directly.
| SETTINGS parameter | Existing field (default) | Sent today | Jetty 12 source | Proposal |
|---|---|---|---|---|
HEADER_TABLE_SIZE (0x1) |
settingsHeaderTableSize (4096) |
4096 (omitted because it is the default) | setMaxDecoderTableCapacity |
Reuse the field and apply it through this setter. |
ENABLE_PUSH (0x2) |
disableServerPush (false, no property) |
not sent, so the server assumes push is enabled | no setter; add it in onOpen() |
Make it configurable. When push is disabled, send ENABLE_PUSH=0 and set maxConcurrentPushedStreams to 0. If we decide not to support it, remove disableServerPush. |
MAX_CONCURRENT_STREAMS (0x3) |
settingsMaxConcurrentStreams (100) |
maxConcurrentPushedStreams (blazemeter.http.maxConcurrentPushedStreams, 100) |
setMaxConcurrentPushedStreams |
Remove the field: the existing property already sets this value. It limits server-initiated (push) streams, not the client's requests. |
INITIAL_WINDOW_SIZE (0x4) |
settingsInitialWindowSize (65535) |
8388608 (Jetty default) | setInitialStreamRecvWindow |
Reuse the field with default 8388608. A 65535 default would shrink the flow-control window and reduce throughput. Consider also exposing setInitialSessionRecvWindow (16 MiB, sent as a connection WINDOW_UPDATE). |
MAX_FRAME_SIZE (0x5) |
settingsMaxFrameSize (16384) |
16384 (omitted because it is the default) | setMaxFrameSize |
Reuse the field and validate the RFC 9113 range (16384 to 16777215). |
MAX_HEADER_LIST_SIZE (0x6) |
settingsMaxHeaderListSize (4096, property) |
not sent (setMaxResponseHeadersSize(-1)) |
setMaxResponseHeadersSize |
Reuse the property, keeping unlimited as the default. This setter also caps response header parsing, so a 4096 default would reject responses with larger headers. |
Proposal
- Call the
HTTP2Clientsetters directly instead of through reflection. Jetty is bundled and relocated in the plugin jar at a known version, so thehasMethodguards only hide mismatches like these. - Wire each field to its Jetty 12 source as in the table, through
blazemeter.http.settings*properties (settingsMaxHeaderListSizealready follows this pattern). Read them inloadProperties. - Remove what has no valid target:
settingsMaxConcurrentStreams, plusdisableServerPushif push control is not added. - Apply the same values to the h2c clients (upgrade and prior knowledge). Build the
HTTP2-Settingsheader from the values the SETTINGS frame actually sends, so the two always agree. - Replace the reflection-based listener with one that works in Jetty 12, or remove it and its warning. If the warning is kept, compare the server's
MAX_HEADER_LIST_SIZEwith the request headers being sent. - Remove
blazemeter.http.skipHttp2Settings, or make it skip the new configuration. - Update the README property table and
docs/http-debug-notes.md.
Acceptance criteria
- A test against a local HTTP/2 server captures the client's SETTINGS frame and checks, for each property, that the configured value is sent. Run it for h2 over TLS, for h2c with upgrade and for h2c with prior knowledge.
- With no properties set, the SETTINGS frame is the same as today (in particular
INITIAL_WINDOW_SIZE=8388608, and noMAX_HEADER_LIST_SIZElimit on responses). - The
HTTP2-Settingsheader of an h2c upgrade matches the SETTINGS frame sent after the upgrade. - No reflection remains for
HTTP2Clientsettings, and no documented property or flag is left without effect.
Notes
- Jetty's HTTP/2 transport can copy some values from
HttpClientontoHTTP2Clientwhen it starts (for examplemaxResponseHeadersSize). The capture test should confirm that the configured values survive that step. - HTTP/3 settings are out of scope.
- Dominant language
- Java
- Stars
- 51
- Forks
- 30
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 8
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Blazemeter/jmeter-http-plugin
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Blazemeter/jmeter-http-plugin#186 ·
-
bug
Difficulty 5/5 Over a week Newbie friendliness 45/100
Blazemeter/jmeter-http-plugin#172 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Blazemeter/jmeter-http-plugin#48 · 1 reaction ·
All issues in Blazemeter/jmeter-http-plugin
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
nextcloud/notes-android#3469 ·
Maintainers usually reply within 1 day
-
installation sdk usability
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
beehive-lab/TornadoVM#1356 ·
Maintainers usually reply within 1 day
-
0. Needs triage enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
davidfercas/opendcanard#34 ·