-
Notifications
You must be signed in to change notification settings - Fork 327
fix: restore HTTP/2 auto-detection and enforce H2 header configurations #8704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
fix: fix bug in http2 header limit
|
@yliu-intuit: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/ |
|
Hi @aaronArinder @abernix , could you help take a look on this PR? |
|
@yliu-intuit: this makes sense; let me validate it and respond in a bit! thanks for opening a pr |
|
alas, I wasn't able to repro the error--it seems to work for me, but that doesn't mean it actually works, it'd be nice to see it working for you here's a video running through it; let me know how to test it to make sure I'm tracking with the problem. Also let me know if you can't see the video for some reason fwiw, I think the http1builder is fine to pass back because the http config has already been set and when the server is built, both configs are available via their respective builders--that's at least what I recollect from reading the hyper code a bit ago, but that might be wrong and I don't have time right now to dig back through it (hopefully seeing it working is enough proof, but again, I might be wrong about it actually working, so send over a repro!) |
|
Hi @aaronArinder , Thanks a lot for taking a look on this and try to reproduce it!! I just did a quick revalidation in v2.9. This is the curl command I am using. No matter how I adjust the config to 1kb or 48kb, the router would return 431 at exactly 16kb single header. |
|
hmmm interesting @aaronArinder , on my side it is getting 431 with this command. |
|
retrying with that curl and config doesn't quite do the dirt; so, I'm wondering if your router isn't getting the right config? It's hitting the default header size limit from hyper, making me think that maybe there's a stale config or it's somehow not getting the right values for the http2 header option? |
|
That's possible that the router doesn't get the config. but we have tested in different environments, in remote environment and in my laptop as well... I just tried again with this PR and the same config. The results are same, 2.9.0 is getting 431 and my fix get 200. Do you know how did Marcelo reproduced the issue? |
|
@aaronArinder I have included a recording inside our support ticket. https://support.apollographql.com/portal/1023/TSH-21029 maybe you can check that |
|
@yliu-intuit: I just saw your video and am kind of confused at what might be wrong; it doesn't look like the config (from the logs, I think it's being taken up), so we probably need to try some other stuff:
|
|
@aaronArinder , sure, let me try that. Let me also try using TLS as well in my local. |
|
ok interesting @aaronArinder , when I build the router binary, it indeed worked with h2c. so what kind of surrounding code could go wrong. and what made this PR worked again with the surrounding code? |
|
let me run with trace level logging and see what happened |
|
Hi @aaronArinder , I have included the trace log inside our support tickets |
|
Hi @aaronArinder , more findings:
|
|
I see, #8673 is not included in the v2.9.0 release |
|
@yliu-intuit: ahhh! yeah, that'd do it. I forgot that I missed the cut date for 2.9.0 with that pr; it should make it into 2.10.0, which should be sometime this month! Sorry about that, if I'd slowed down to think about it I'd probably have remembered |


Summary
This PR fixes a bug in the connection setup logic where HTTP/2 configurations (specifically
http2_max_headers_list_bytes) were being ignored.Root Cause Analysis
The issue stems from how the
hyper_utilbuilders were being used. Theconfigure_connectionhelper function was returning anHttp1Builder(the result of.http1()) rather than the parentauto::Builder.By calling
.serve_connection()on the childHttp1Builderinstance, the application effectively started a standard HTTP/1.1 server. This has two specific consequences:max_header_list_size) was dropped and never applied to the active connection.Visualizing the Issue:
Checklist
Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.
Exceptions
Note any exceptions here
Notes
Footnotes
It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this. ↩
Configuration is an important part of many changes. Where applicable please try to document configuration examples. ↩
A lot of (if not most) features benefit from built-in observability and
debug-level logs. Please read this guidance on metrics best-practices. ↩Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions. ↩