Repository navigation
refactor(backends): remove the unused BackendMap::max_failures field - #1857
Merged
Merged
Conversation
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
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the public
BackendMap::max_failuresfield.BackendMap::newandBackendMap::with_seedinitialised it to3, and nothing in the workspace reads it; it has had no effect since at least #514. Backend failure handling is the per-backendExponentialBackoffPolicyretry policy plus the session-levelmax_connection_attemptslimit.Library API change: the public field is removed from
BackendMap. No runtime behaviour changes. ACHANGELOG.mdentry is added under[Unreleased]→ Removed.Evidence the field is unused
Tree-wide grep at
origin/main(0f5430cc), no file-type filter, formax[-_ ]?failures|maxfailures(case-insensitive): onlylib/src/backends.rs:468(declaration) andlib/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-libcargo check -p sozu-lib --all-targetswithcrypto-aws-lc-rsandcrypto-opensslcellscargo check -p sozu-e2e -p sozu-sim --all-targets,cargo check --all-targetsinfuzz/cargo +1.93.1 clippy --workspace --all-targets --no-default-features --features crypto-ring,opentelemetry,splice,simd -- -D warningscargo +nightly fmt --all --check,python3 .github/scripts/check_doc_citations.py --root . --base origin/main