Skip to content

test(mux): name the error-GOAWAY linger routing regression - #1876

Merged
FlorentinDUBOIS merged 1 commit into
mainfrom
fix/h2-error-linger-unstarted-link
Oct 6, 2026
Merged

FlorentinDUBOIS merged 1 commit into
mainfrom
fix/h2-error-linger-unstarted-link

Conversation

@FlorentinDUBOIS

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #1875 review notes.

  • an_error_goaway_linger_pending_on_close_notify_releases_before_pending_links failed on the old gate only through RemoveOnlyProxy::sessions' generic unreachable!("closing a backend only removes its session"). It now uses a test-only NoRoutingProxy whose routing methods panic with "pending_links routed a stream of an error-GOAWAY linger". Its assertions are unchanged.
  • A stream in Link or Linked always carries metrics.start: every SessionMetrics::reset either moves the stream out of Link/Linked or re-arms the start (create_stream), first entries into Link follow service_start(), re-links come only through backend_streams, which unlink_stream cleans, and Linked comes only from link_stream behind the Link guard. release_streams_and_backends_for_error_linger now states this with a debug_assert! before its early return, so a future violation cannot skip the release silently. No behaviour change in release builds.

Refs #1875

Verification

  • Old fix(h2): release an error-GOAWAY linger's streams while it is pending #1875 gate restored temporarily: the test fails with pending_links routed a stream of an error-GOAWAY linger; green with the gate.
  • cargo test -p sozu-lib --no-default-features --features crypto-ring (1612 passed, debug assertions on), clippy --all-targets -D warnings, cargo +nightly fmt --check, check_doc_citations.py: green.

`an_error_goaway_linger_pending_on_close_notify_releases_before_pending_links`
failed on the old `Connection::lingers_after_error_goaway` gate only
through `RemoveOnlyProxy`'s generic "closing a backend only removes its
session". It now runs against a dedicated `NoRoutingProxy` stub whose
routing view and registration panic with "pending_links routed a stream
of an error-GOAWAY linger"; what the test asserts is unchanged.

`Mux::release_streams_and_backends_for_error_linger` selects the streams
it recycles by `metrics.start.is_some()`. A stream in `StreamState::Link`
or `Linked` always carries its start: every first entry into `Link` arms
it through `SessionMetrics::service_start`, every other entry re-links a
stream that was already linked, `Linked` is reached only from `Link`,
and no `SessionMetrics::reset` leaves a stream in either state. A
debug-only pre-condition now states that invariant before the early
return, where the existing post-condition could not see it.

Refs: #1875
Signed-off-by: Florentin Dubois <[email protected]>
@FlorentinDUBOIS
FlorentinDUBOIS merged commit fcb403d into main Oct 6, 2026
37 of 38 checks passed
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.

1 participant