Skip to content

QUIC: twins log 200/DC (~12 per proxy roll) where h2 logs a clean response; not client-visible per the k6 join #1009

Closed

Description

@bpalermo

Finding (rev242 proving QUIC soak, 2026-09-27)

The source proxies logged 74 200/DC lines (svc-1 36, svc-2 38) plus 11 0/DC for k6 requests to the two QUIC twins, only at the six proxy rolls (~12 per roll), and none for the h2 destinations (svc-3, svc-4, echo, mixed-svc) at the same rolls. rev239's full run had none on any destination.

The k6 reconciliation shows these were not client-visible: k6's 1,154 failures are exactly the 1,060 503/NC (#1008) + 92 504/UT + 2 503/UC lines; every DC line was a request k6 counted as a success.

So on the QUIC path the draining proxy generation completes the response but records the downstream as gone, where the h2 path records a clean -. Most likely the h3 pool's drain during hot-restart handoff marks the downstream connection closed after the response has already been flushed (the response was delivered, k6 saw 200).

Ask

Low severity, but it is a difference between the two paths at exactly the moment (#991, hot-restart handoff) we watch most closely, and DC is a flag the soak grade treats as a failure class. Either attribute it (which side closed, and at which handoff phase) and document it as a benign artefact of the h3 drain, or fix the flag. Until then the soak grader must join DC on @ clusters against k6 before counting it.

Grader record: project_soak_20260927_rev242_run. Related: #1008, #991, #979.

Activity

  1. added
    bug
    on Sep 27, 2026
  2. bpalermo commented on Sep 28, 2026

    @bpalermo
    OwnerAuthor

    Mechanism (source read at the pinned Envoy 726d7ac; nothing modified)

    Evidence (rev242 soak, VictoriaLogs): all 74 DC lines are reporter=source, 200, protocol=HTTP/1.1 (k6's connection into capture), response_code_details=downstream_remote_disconnect, bytes_sent=791 — identical to the clean 200s to the same twins. The full body was written before the stream died. The "11 × 0/DC" in the report does not reproduce under response_flags:~"DC".

    Where DC comes from: the only HTTP site that sets DownstreamConnectionTermination is ConnectionManagerImpl::onEvent (conn_manager_impl.cc:696-728) on a downstream Remote/LocalClose → doConnectionClose → resetAllStreams (670-693, sets the flag + downstream_remote_disconnect), and only while the stream is still in streams_. Router/filter_manager never set DC; upstream resets map to UC/UR/LR. Drain itself sets no flag: for h1 it only stamps Connection: close on the response headers (2116-2123).

    Why only h3: a race. The draining parent stamps Connection: close; k6 has the whole Content-Length body and closes the socket; that RemoteClose runs resetAllStreams while the source's ActiveStream is still alive because the upstream end-of-stream has not been decoded yet. EnvoyQuicClientStream::OnBodyAvailable (envoy_quic_client_stream.cc:339-389) passes end_stream only when IsDoneReading(), so a FIN in a later packet/read event yields decodeData(body,false) then decodeData(empty,true) later. nghttp2 delivers DATA+END_STREAM from the same TCP read, so on h2 the stream ends before k6 can close. Why the h3 FIN lags the body is inferred (packetization / ACK pacing), not proven.

    Verdict: cosmetic. Client-initiated close after a complete body; k6 counted every one a success. A real early close would show downstream_local_disconnect(...) or short bytes_sent.

    Change (aether side, no Envoy lever exists to end a stream on a satisfied Content-Length):

    1. agent/internal/xds/proxy/accesslog.go: add %COMMON_DURATION(US_RX_BEG:US_RX_END:ms)% and %COMMON_DURATION(US_RX_BEG:DS_TX_END:ms)% so a DC line shows whether the upstream FIN had landed.
    2. Soak grader (e2e/soak/README.md): DC with response_code_details=downstream_remote_disconnect and bytes_sent equal to the clean-line body size is benign and excluded from the failure class; anything else stays a failure.
    3. Kind proof: e2e/eastwest-quic.sh + an HTTP/1.1 keep-alive loop to an h3 destination + a supervisor hot restart of the source proxy; assert each DC line matches the benign shape and the h2 control logs -; --component-log-level quic:debug,http:debug shows decodeData end_stream after "stream reset: reset reason: connection termination".
  3. added a commit that references this issue on Sep 28, 2026
  4. bpalermo commented on Sep 28, 2026

    @bpalermo
    OwnerAuthor

    Phase C on rev248 (1.0.3-763e257, the #1048 fields), 2026-09-28 15:44–17:02Z: 5 × rollout restart ds/aether-proxy under 300 rps of k6 load to the two QUIC twins.

    Every DC line in the window, by shape:

    reporter code flags details bytes_sent upstream_rx_ms downstream_tx_end_ms n
    source 200 DC downstream_remote_disconnect 791 - - 115
    source 0 DC downstream_remote_disconnect 0 - - 5

    791 is exactly the clean-line body on both twins (830k clean lines in the same window). Per roll: 26 / 29 / 20 / 12 / 28, spread over all five nodes. Both timing fields blank on every race line, as #1048 predicted (the stream is logged before either end marker fires). The mechanism is confirmed in production; the benign rule matches all 115.

    The 5 0/DC are not the race: they are k6 connections severed at 16:38:45.96 when the supervisor's watchdog killed both Envoy epochs on main-worker-02 (#1050). They stay a failure under the rule, correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions