Skip to content

e2e: continuation-during-graceful-drain test fails under CPU contention (single GOAWAY) #1623

Closed

Description

@FlorentinDUBOIS

Symptom

tests::h2_tests::test_h2_continuation_survives_a_graceful_drain_mid_reassembly fails under CPU contention. The client reads a single GOAWAY(NO_ERROR), then nothing: neither the anchor response (stream 1) nor stream 3's.

H2 CONTINUATION+drain - received 1 frames
  frame 0: GOAWAY error_code=0x0
H2 CONTINUATION+drain - anchor_ok=false stream3_ok=false drain_witnessed=true sent=true
stability check FAILED: iteration 4 of 5 did not succeed (5 consecutive successes are required)

A passing iteration reads 8 frames: the advisory GOAWAY, both responses, then the final GOAWAY.

Measured failure rate (2026-09-27)

The H2 e2e suite ran 10 times, pinned to one CPU with the default thread count:

taskset -c 0 cargo test -p sozu-e2e -- h2 --skip tests::fuzz_tests:: --test-threads=20

The failure does not reproduce with the test alone, even with four yes busy loops on the same CPU (0 of 3 on both trees). It needs the concurrent suite.

Likely cause (hypothesis, not verified)

The listener's default h2_graceful_shutdown_deadline_seconds is 5 s (HttpsListener::get_h2_graceful_shutdown_deadline, lib/src/https.rs). After soft_stop(), the test itself makes several control-plane round-trips, each waited for up to 5 s: server.live reaching 0, then the block completing. Only after that does it release the backend. When those waits add up past the drain budget, Mux::shutting_down force-closes the session, and the client sees only the advisory GOAWAY. The client also stops reading about 1.5 s after the first byte (collect_response_frames(&mut tls, 50, 30, 50)).

Suggested fix

Give this test's listener an explicit h2_graceful_shutdown_deadline_seconds well above the sum of its own waits. Also collect frames until END_STREAM or EOF, not for a fixed window.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions