Skip to content

refactor(backends): remove the unused BackendMap::max_failures field - #1857

Merged
FlorentinDUBOIS merged 1 commit into
mainfrom
chore/remove-backendmap-max-failures
Oct 4, 2026
Merged

FlorentinDUBOIS merged 1 commit into
mainfrom
chore/remove-backendmap-max-failures

Conversation

@FlorentinDUBOIS

Copy link
Copy Markdown
Collaborator

Summary

Removes the public BackendMap::max_failures field. BackendMap::new and BackendMap::with_seed initialised it to 3, and nothing in the workspace reads it; it has had no effect since at least #514. Backend failure handling is the per-backend ExponentialBackoffPolicy retry policy plus the session-level max_connection_attempts limit.

Library API change: the public field is removed from BackendMap. No runtime behaviour changes. A CHANGELOG.md entry is added under [Unreleased] → Removed.

Evidence the field is unused

Tree-wide grep at origin/main (0f5430cc), no file-type filter, for max[-_ ]?failures|maxfailures (case-insensitive): only lib/src/backends.rs:468 (declaration) and lib/src/backends.rs:515 (initialisation). No proto field, config key, CLI flag, doc, fixture, e2e, fuzz or sim reference.

Tests

No test can go red for a dead-field removal, so none is added; compilation across feature cells plus the full suites are the check:

  • cargo test -p sozu-lib --no-default-features --features crypto-ring,opentelemetry,splice,simd (1637 passed, 0 failed)
  • cargo test -p sozu (same features), cargo test -p sozu-command-lib
  • cargo check -p sozu-lib --all-targets with crypto-aws-lc-rs and crypto-openssl cells
  • cargo check -p sozu-e2e -p sozu-sim --all-targets, cargo check --all-targets in fuzz/
  • cargo +1.93.1 clippy --workspace --all-targets --no-default-features --features crypto-ring,opentelemetry,splice,simd -- -D warnings
  • cargo +nightly fmt --all --check, python3 .github/scripts/check_doc_citations.py --root . --base origin/main

BackendMap::new and BackendMap::with_seed initialised the public
max_failures field to 3, and nothing in the workspace read it; it has
had no effect since at least #514. Backend failure handling is the
per-backend ExponentialBackoffPolicy retry policy plus the
session-level max_connection_attempts limit.

Library API change: the public field is removed. No runtime behaviour
changes.

Signed-off-by: Florentin Dubois <[email protected]>
@FlorentinDUBOIS
FlorentinDUBOIS merged commit 016b939 into main Oct 4, 2026
29 checks passed
FlorentinDUBOIS added a commit that referenced this pull request Oct 5, 2026
Since #1856 a BackendList derives its sibling ring, shuffle-sharding
representatives and shared-address flag from the backend vector, and only
add_backend/remove_backend refresh them (and the Maglev table). The field
was public, so an embedder could push to or remove from the vector and
leave that state stale.

The field is now pub(crate) and BackendList::backends() returns a
read-only slice. The one external reader in the workspace, the
udp_health_descriptor_exhaustion integration test, uses the accessor.
Two doctests on the accessor hold the guarantee: one reads the list,
and an otherwise identical compile_fail,E0616 one pushes to the field
from outside the crate. The length-mismatch guards from #1856 stay for
in-crate misuse.

Library API break, recorded in the CHANGELOG beside the
BackendMap::max_failures removal (#1857).

Signed-off-by: Florentin Dubois <[email protected]>
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