feat(http2): configure header list size for tcp/uds#8673
Conversation
✅ Docs preview readyThe preview is ready to be viewed. View the preview File Changes 0 new, 1 changed, 0 removedBuild ID: dacd44e79706b137ce76a4ad URL: https://www.apollographql.com/docs/deploy-preview/dacd44e79706b137ce76a4ad |
This comment has been minimized.
This comment has been minimized.
202718e to
a1cf753
Compare
| if let Some(max_header_list_size) = opt_max_http2_headers_list_bytes { | ||
| // ByteSize has a .as_u64(), but doesn't have a as_u32(), to explain | ||
| // this funky `as` conversion | ||
| builder.max_header_list_size(max_header_list_size.as_u64() as u32); |
There was a problem hiding this comment.
Could it happen that the header size would be bigger than u32::MAX ? If so I would prefer using u32::try_from() instead of as cast. WDYT ?
There was a problem hiding this comment.
technically yes, but practically I don't think so; there'd have to be ~4.3gb of headers for u32 (and almost 20k petabytes for usize), which would probably choke the router somewhere earlier; but, I've added a try_from() and a warning log just in case (because who knows what folks get up to)
| } | ||
|
|
||
| if let Some(max_buf_size) = opt_max_http1_buf_size { | ||
| builder.max_buf_size(max_buf_size.as_u64() as usize); |
54fb945 to
e548b8b
Compare
|
Hi @aaronArinder , the fix didn't work with our TCP connections. We continue to receive 431 when sending 10KB single header despite setting the config of The issue is fixed when specifically check for HTTP2 connection and apply This is caused by using the auto-detection
I have a fix that force using However, I am still looking into why #8631 works. #8631 is using the same logic as in this PR. |
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. ↩