Skip to content

http2: make frames-after-END_STREAM integration tests codec-aware - #47816

Closed
citrus7 wants to merge 1 commit into
envoyproxy:mainfrom
citrus7:http2-frames-after-end-stream-codec-aware
Closed

citrus7 wants to merge 1 commit into
envoyproxy:mainfrom
citrus7:http2-frames-after-end-stream-codec-aware

Conversation

@citrus7

@citrus7 citrus7 commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Commit Message: http2: make frames-after-END_STREAM integration tests codec-aware
Additional Description:
The integration tests added in #47507 (DownstreamHeadersAfterEndStream,
DownstreamDataAfterEndStream and UpstreamHeadersAfterEndStream) assume
that a frame received on a half-closed (remote) stream always results in a
connection-level protocol error.

RFC 9113 Section 5.1 specifies this as a stream error of type
STREAM_CLOSED. oghttp2 is gaining an adapter-level check that resets only
the offending stream with RST_STREAM(STREAM_CLOSED) and never delivers the
frame to the codec. With that check the Oghttp2 variants of these tests
fail: the connection is not closed and *_cx_protocol_error is not
incremented.

This change makes the tests accept either valid rejection:

  • nghttp2, and oghttp2 without the adapter check: the connection is closed
    and *_cx_protocol_error is incremented.
  • oghttp2 with the adapter check: RST_STREAM(STREAM_CLOSED) is sent for the
    offending stream, and the connection is not torn down.

The tests pass with both the current QUICHE and a QUICHE that has the
oghttp2 check, so the QUICHE bump won't break them.

It also adds DownstreamRequestHeadersAfterEndStream, which covers a
second full request HEADERS frame on a stream the client already ended.

Risk Level: Low (test only)
Testing: Ran the modified tests repeatedly against oghttp2 both with and
without the half-closed (remote) check, and against nghttp2.
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Jonathan Wu [email protected]

@citrus7
citrus7 force-pushed the http2-frames-after-end-stream-codec-aware branch from f9dc7c2 to 43286de Compare September 28, 2026 15:35
RFC 9113 Section 5.1 treats a frame received on a half-closed (remote) stream as a stream error of type STREAM_CLOSED. oghttp2 is gaining an adapter-level check that resets only the offending stream, so the tests added in envoyproxy#47507 now accept either a connection-level protocol error (nghttp2, older oghttp2) or RST_STREAM(STREAM_CLOSED) (oghttp2). Also adds a regression test for a second request HEADERS frame on an ended stream.

Signed-off-by: Jonathan Wu <[email protected]>
@citrus7
citrus7 force-pushed the http2-frames-after-end-stream-codec-aware branch from 43286de to aaf7f03 Compare September 28, 2026 16:09
copybara-service Bot pushed a commit to google/quiche that referenced this pull request Sep 29, 2026
… and remove the http2_reject_half_closed_remote flag.

The fix for b/514675798 exists in two layers:

* `OgHttp2Session` (cl/934350045): a `HEADERS` or `DATA` frame on a half-closed (remote) stream is a stream error, so oghttp2 sends `RST_STREAM(STREAM_CLOSED)` (RFC 9113 Section 5.1). This was guarded by `quiche_reloadable_flag_http2_reject_half_closed_remote` and stripped from the QUICHE export.
* Envoy `Http::Http2::ConnectionImpl` (upstream PR #47507): the same frames are treated as a connection-level protocol error. This is guarded by `envoy.reloadable_features.http2_reject_frames_after_end_stream`.

The upstream Envoy tests assumed the second behavior on both codecs. With the oghttp2 check in place they failed on oghttp2, which is why the runtime guard was disabled in google3.

This CL:

* Makes the `OgHttp2Session` check unconditional and removes the QUICHE flag, code counts and `quiche:google3` markers so it is exported to OSS QUICHE. oghttp2 users outside Envoy keep the protection, and the `HalfClosedRemote*` tests in `oghttp2_session_test.cc` are kept.
* Moves the `gfe2_reloadable_flag_http2_reject_half_closed_remote` config to `deprecated/`. The flag has defaulted to true since 2026-08-31, so GFE behavior does not change. GFE2 code counts were zero (b/514675798#comment16).
* Enables `envoy.reloadable_features.http2_reject_frames_after_end_stream` (`RUNTIME_GUARD`) and removes the Copybara transforms that disabled it and its tests.
* Replaces `b514675798-reject-half-closed-remote.patch` with `b514675798-codec-aware-end-stream-tests.patch`. This patch makes the `*AfterEndStream` tests in `http2_integration_test.cc` accept either a connection-level protocol error (nghttp2) or `RST_STREAM(STREAM_CLOSED)` (oghttp2), and adds `DownstreamRequestHeadersAfterEndStream`. It covers the same scenarios as the removed `Http2HalfClosedRemoteTest`. The change is upstreamed in envoyproxy/envoy#47816; remove the patch once that is imported.

Tested: `http2_integration_test` `*AfterEndStream*` (3 runs each) with the oghttp2 check enabled, and with it disabled to simulate current OSS QUICHE; `oghttp2_session_test`.
PiperOrigin-RevId: 990357353
@citrus7

citrus7 commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@mattklein123 mattklein123 self-assigned this Sep 30, 2026
phlax pushed a commit that referenced this pull request Oct 8, 2026
Update QUICHE from 7f07dc4 to 9e60ac2
https://github.com/google/quiche/compare/7f07dc4..9e60ac2

This change patches the pending envoy change
#47816. Therefore, #47816 is
obsolete now.

Registry:
envoyproxy/bazel-registry@20dc7c2

```
$ git log 7f07dc4..9e60ac2 --date=short --no-merges --format="%ad %an %s"

2026-09-23 martinduke Deprecate quic_check_alternate_reset_token.
2026-09-23 birenroy Adds an `AbidingObjectPool` utility in `quiche/common`.
2026-09-23 martinduke MOQT: Ignore OnSubgroupAbandoned for groups before first_active_group_.
2026-09-23 martinduke Enforce draft-18 namespace restrictions.
2026-09-23 apaseltiner Add Visit method to ParameterizedMember
2026-09-23 martinduke Update Stream Error codes to MOQT draft-18.
2026-09-23 martinduke Implement draft-18 PADDING streams and datagrams.
2026-09-23 martinduke Unknown Uni Stream types are a protocol error.
2026-09-23 martinduke Handle null session in MoqtLivePublisher::OnNewObjectAvailable.
2026-09-23 martinduke Return session error if a request ID is reused in a SUBSCRIBE, or has the wrong parity. Other cases would require unbounded state to detect.
2026-09-24 vasilvv Ensure QUIC only sends ACK timestamps for actually acked packets
2026-09-24 QUICHE team Reorder fields in `QpackInstructionDecoder` to reduce its size from 168B to 152B (go/memory-cy).
2026-09-24 martinduke Eliminate uninitialized value in MoqtParserTest
2026-09-24 asedeno Lift QuicByteCount and QuicEcnCodepoint into a new quiche/common/quiche_types.h.
2026-09-24 martinduke Fix msan error in MoqtSessionTest
2026-09-25 QUICHE team Set the failure reason before reporting a failure when no CID is available
2026-09-25 QUICHE team Encode what caused a new validation to cancel a pre-existing one in
2026-09-25 QUICHE team Change return types of HistogramEnumString from std::string to absl::string_view.
2026-09-25 apaseltiner Simplify stream priority serialization
2026-09-25 apaseltiner Add Visit method to structured-headers Item type
2026-09-27 vasilvv Add some of the missing frame types to `QuicIetfFrameTypeString`.
2026-09-28 ianswett Allow configuring active_connection_id_limit via connection options in QUIC.
2026-09-28 apaseltiner Mark structured-headers constructors and operators noexcept where relevant
2026-09-28 birenroy Moves Allocate() and Deallocate() into AbidingObjectPool's public interface.
2026-09-29 apaseltiner Reject leading asterisks on tokens in Draft 09 structured headers.
2026-09-29 QUICHE team Enable envoy.reloadable_features.http2_reject_frames_after_end_stream and remove the http2_reject_half_closed_remote flag.
2026-09-29 martinduke Update GOAWAY format to MOQT draft-18.
2026-09-29 Monica Chintala No public description
2026-09-30 QUICHE team Reorder fields in `PragueSender` to reduce its size from 360B to 352B (go/memory-cy).
2026-09-30 QUICHE team Reorder fields in `QuicCryptoNegotiatedParameters` to reduce its size from 360B to 352B (go/memory-cy).
2026-09-30 QUICHE team Gracefully handle crypto frame outstanding checks after crypto substreams are reset.
2026-09-30 martinduke MOQT Session-level handling of draft-18 GOAWAY.
2026-10-01 martinduke Always send STOP_SENDING on Reset() unless RESET has already been received.
2026-10-01 QUICHE team Expose the number of available peer-issued CIDs
2026-10-01 asedeno Preserve nghttp2 1.66.0 callback behavior in NgHttp2Adapter.
2026-10-01 vasilvv QUIC_BUG when attempting to use QUIC timestamps code with gQUIC
2026-10-02 birenroy No public description
2026-10-02 ianswett Support bundling retransmitted CRYPTO frames via the BCFR connection option.
2026-10-02 ripere Add multiqueue status to the QBONE bonnet server status page.
2026-10-02 jprat Add an `oghttp2` option to cap outbound DATA frame payload size.
2026-10-05 Monica Chintala Add span constructors to QuicDataWriter
2026-10-06 martinduke Send LARGEST_OBJECT when REQUEST_UPDATE sets Forward=1 or moves the filter end back.
2026-10-06 vasilvv Only record timestamps for 1-RTT packets.
2026-10-06 vasilvv Make `last_timestamp` a local variable.
2026-10-06 vasilvv Ensure QUIC receive timestamps are always in future relative to the framer creation time.
2026-10-06 QUICHE team Migrate ABSL_ARRAYSIZE()/arraysize() to std::size(), std::extent_v, or other alternatives where possible
2026-10-06 asedeno OSS QUICHE: Move `nghttp2_test.cc` to `nghttp2_tests_srcs`.
```

Signed-off-by: Prateek Jain <[email protected]>
@citrus7 citrus7 closed this Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants