Skip to content
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

Make http3 codec not encode empty trailers block #35907

Merged
merged 5 commits into from
Sep 4, 2024

Conversation

ravenblackx
Copy link
Contributor

@ravenblackx ravenblackx commented Aug 29, 2024

Commit Message: Make http3 codec not encode empty trailers block
Additional Description: http3 and grpc_web_filter combined resulted in an incompatibility with Chrome - a grpc web request received a response with an empty trailers block, which Chrome treats as a network error. The http2 codec had a special case in it for empty trailers, which was not mimicked in the http3 codec. This PR makes the http3 codec similar to the http2 codec in this respect, and adds an integration test ensuring that this behavior is in all downstream codecs.
Risk Level: Small. It is a behavior change, but from an already malfunctioning state in a rare edge case.
Testing: Added integration test which fails before the change and passes after.
Docs Changes: n/a
Release Notes: Yes
Platform Specific Features: n/a

@ravenblackx
Copy link
Contributor Author

/retest

@ravenblackx
Copy link
Contributor Author

(Failure appears to be a flake added in #34461)

@ravenblackx
Copy link
Contributor Author

/retest

Copy link
Contributor

@RyanTheOptimist RyanTheOptimist left a comment

Choose a reason for hiding this comment

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

Nice! Thanks for fixing this. I think we should probably have a runtime guard for this, on the off chance that this behavior change breaks someone. LGTM otherwise.

Signed-off-by: Raven Black <[email protected]>
Copy link

CC @envoyproxy/runtime-guard-changes: FYI only for changes made to (source/common/runtime/runtime_features.cc).

🐱

Caused by: #35907 was synchronize by ravenblackx.

see: more, trace.

RyanTheOptimist
RyanTheOptimist previously approved these changes Sep 3, 2024
Copy link
Member

@phlax phlax left a comment

Choose a reason for hiding this comment

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

docs/changelog nits ...

@@ -107,7 +107,9 @@ bug_fixes:
- area: http3
change: |
Fixed a bug where an empty trailers block could be sent. This would occur if a filter removed
the last trailer - a likely occurrence with the ``grpc_web_filter``.
the last trailer - a likely occurrence with the ``grpc_web_filter``. This change makes http3 codec
behave the same way http2 codec does, converting an empty trailers block to no trailers.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
behave the same way http2 codec does, converting an empty trailers block to no trailers.
behave the same way HTTP/2 codec does, converting an empty trailers block to no trailers.

@@ -107,7 +107,9 @@ bug_fixes:
- area: http3
change: |
Fixed a bug where an empty trailers block could be sent. This would occur if a filter removed
the last trailer - a likely occurrence with the ``grpc_web_filter``.
the last trailer - a likely occurrence with the ``grpc_web_filter``. This change makes http3 codec
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
the last trailer - a likely occurrence with the ``grpc_web_filter``. This change makes http3 codec
the last trailer - a likely occurrence with the ``grpc_web_filter``. This change makes HTTP/3 codec

the last trailer - a likely occurrence with the ``grpc_web_filter``.
the last trailer - a likely occurrence with the ``grpc_web_filter``. This change makes http3 codec
behave the same way http2 codec does, converting an empty trailers block to no trailers.
This behavior can be reverted by setting the runtime guard ``envoy.reloadable_features.http3_remove_empty_trailers`` to false.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
This behavior can be reverted by setting the runtime guard ``envoy.reloadable_features.http3_remove_empty_trailers`` to false.
This behavior can be reverted by setting the runtime guard ``envoy.reloadable_features.http3_remove_empty_trailers`` to ``false``.

Signed-off-by: Raven Black <[email protected]>
Copy link
Member

@phlax phlax left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@ravenblackx ravenblackx enabled auto-merge (squash) September 3, 2024 17:46
@ravenblackx
Copy link
Contributor Author

/retest

2 similar comments
@ravenblackx
Copy link
Contributor Author

/retest

@ravenblackx
Copy link
Contributor Author

/retest

@ravenblackx ravenblackx merged commit b5bc273 into envoyproxy:main Sep 4, 2024
39 of 40 checks passed
@ravenblackx ravenblackx deleted the http3_trailers branch September 5, 2024 20:58
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