Skip to content

docs: align the example configuration and docs with recent changes - #1809

Merged
FlorentinDUBOIS merged 1 commit into
mainfrom
docs/sync-config-and-docs
Oct 3, 2026
Merged

FlorentinDUBOIS merged 1 commit into
mainfrom
docs/sync-config-and-docs

Conversation

@FlorentinDUBOIS

Copy link
Copy Markdown
Collaborator

Audit of the docs, bin/config.toml and os-build/config.toml against everything merged on main from 2026-10-01 to 2026-10-03 (43 commits, #1724 through #1808). Most of the new keys were already documented by their own PRs (max_connection_attempts, h2_stream_refusal_percent, health check mode/accepted_statuses, the raised flood defaults, the 16 MiB connection window). This PR fixes what was still stale.

Area Where Was Now
#1806 bin/config.toml, os-build/config.toml answer comments 503 only for "no backend available"; "504 means the backend timed out" 503 also when every attempt failed; 504 = connected backend silent or frontend timeout while waiting; connect timeout fails over
#1806 bin/config.toml max_connection_attempts connect timeout always fails over a TCP session whose connect times out is closed
#1806 doc/debugging_strategies.md 503 after a circuit breaker of 3 failed connections; ERROR log lines, one that no longer exists max_connection_attempts (default 5), backend.connect.retries_exhausted, real TCP log levels and text
#1806 doc/configure.md front_timeout / connect_timeout rows "inactivity for a request to connect" time to establish a backend connection; HTTP fails over, TCP closes; H1 failover bound by front_timeout
#1806 doc/configure.md client_timeout_during_response, backend_timeout, http.503.errors "connection-level slowness", "circuit breaker" failover case included; established connection only; attempt budget
#1806 LIFECYCLE.md backend timer 504 for any linked stream established connection only
#1806 cli.rs help, doc/configure_cli.md "answered 503" "or a TCP session is closed"
#1756 doc/configure.md flood metrics RST lifetime rows described as absolute ceilings; no window_update_stream0_window row floor-and-ratio semantics; row added
#1756/#1798 doc/architecture.md, doc/h2_mux_internals.md 6 / 13 H2FloodConfig thresholds 14, with h2_stream_refusal_percent
#1756 doc/configure_admin_ops.md "halve" example 50/25 (old defaults); H2 knobs HTTPS only 1000/500; HTTP and HTTPS; h2.flood.stream_refused
#1752 doc/configure.md glitch tuning "1 MiB window ... about 64" frames 64 KiB stream window, about four
#1805 doc/health_checks.md remove resets backends to healthy; DOWN logs an error; load_balancing.rs::BackendList::healthy backends keep their last state (see note); warning; BackendList::select_tiers in backends.rs
#1805 doc/metrics.md health-check counters "per cluster" unlabelled
#1805 doc/configure_cli.md no health-check section short section, --mode, --probe-timeout vs global --timeout
#1746 cli.rs --load-balancing-policy, bin/config.toml, proto comment HRW/MAGLEV key = UDP flow key UDP affinity key (source IP, or IP and port)
UDP doc/configure.md hot upgrade drains flows bounded by idle timeout; udp.flows.evicted reasons soft-stop closes flows at once; listener removal/soft-stop/abort added
#1770 doc/udp_simulation.md no per-source limits in reconfig storms and the invariant list
#1743 doc/lifetime_of_a_session.md keep-alive backend always reused unless its backend was removed
older command.proto update messages h2_stream_shrink_ratio >= 1 >= 2, as validated in state.rs
#1806 e2e shuffle-sharding doc comment "three connection attempts" max_connection_attempts (5 by default)

Reported here, not changed in this PR:

  • sozu cluster health-check remove does not reset backends a probe marked DOWN (remove_health_check_state skips the reset that set_health_check_config(None) does), so they stay out of rotation until the cluster is added again. The doc now describes this. It looks like a code bug.
  • sozu top's H2 pane reads h2.flood.violation.{rapid_reset,made_you_reset,ping,settings,priority,continuation}, which the detector never emits (it emits rst_stream_pre_response_lifetime, ping_window, ...). Only glitch_window matches, and h2.flood.stream_refused is not shown.
  • h2_flood_detector.rs comments still refer to a 1 MiB connection window, and the h2_stream_idle_timeout_seconds proto comment says "Default: 30" where the value inherits back_timeout.
  • connections.rejected_per_cluster_ip is documented as also counting TCP rejections; only the HTTP 429 path increments it.

Validation:

  • sozu config check passes on bin/config.toml, on a copy with every commented key under review uncommented (global and cluster max_connection_attempts, the H2 block, the health check block), and on os-build/config.toml with local state/socket paths. Negative controls (max_connection_attempts = 0; expected_status = 200 next to accepted_statuses) are rejected.
  • cargo +1.93.1 test -p sozu-command-lib --all-features --locked: 235 passed.
  • cargo +1.93.1 test -p sozu --bin sozu --locked: 124 passed (including the --load-balancing-policy help tests).
  • cargo +nightly fmt --all --check and python3 .github/scripts/check_doc_citations.py --root . --base origin/main are clean.

Audit the documentation, bin/config.toml and os-build/config.toml against
the changes merged on main from 2026-10-01 to 2026-10-03 and fix every
statement that no longer matches the code:

- connection attempts (#1806): 503 and 504 answer comments in both
  example configurations, the TCP close on connect timeout, the
  front_timeout and connect_timeout rows, the access-log timeout tokens,
  http.503.errors, the three-attempt circuit breaker and its stale log
  lines in doc/debugging_strategies.md, the TCP close in the CLI help;
- H2 flood protection (#1756, #1798): floor-and-ratio semantics of the
  RST_STREAM lifetime violation metrics, the missing
  window_update_stream0_window metric row, fourteen H2FloodConfig
  thresholds, the admin-ops worked example against the current
  defaults, h2.flood.stream_refused, h2_stream_refusal_percent among
  the listener-update fields;
- health checks (#1805): health-check remove keeps the last health
  state, DOWN logs a warning, the fail-open citation, unlabelled
  health_check counters, a configure_cli.md section, the TCP-mode
  timeout comment;
- UDP (#1746, #1770): HRW/MAGLEV key on the affinity key rather than
  the flow key, soft-stop closes flows at once, udp.flows.evicted
  reasons, per-source limits in the simulation doc;
- pooled connections to a removed backend are not reused (#1743);
- the h2_stream_shrink_ratio floor of 2 in the update-message comments.

Documentation only, no behaviour change.

Signed-off-by: Florentin Dubois <[email protected]>
@FlorentinDUBOIS
FlorentinDUBOIS merged commit bd787ac into main Oct 3, 2026
28 checks passed
FlorentinDUBOIS added a commit that referenced this pull request Oct 3, 2026
…ic-names

#1809 added the `h2.flood.violation.window_update_stream0_window` row to
doc/configure.md; keep its copy, drop this branch's duplicate, and drop
the CHANGELOG sentence that claimed the row.

Signed-off-by: Florentin Dubois <[email protected]>
FlorentinDUBOIS added a commit that referenced this pull request Oct 3, 2026
…ve-resets-backends

#1809 rewrote the `health-check remove` paragraph of doc/health_checks.md
to describe the behaviour #1811 fixes; keep this branch's wording (backends
reset to healthy, in-flight probes dropped) and drop the clause of #1809's
CHANGELOG entry that documented the old behaviour.

Signed-off-by: Florentin Dubois <[email protected]>
FlorentinDUBOIS added a commit that referenced this pull request Oct 3, 2026
…s removed (#1814)

## What

`sozu cluster health-check remove` now resets the backends a probe marked DOWN, as `doc/health_checks.md` already states. `Server::remove_health_check_state` only dropped the cluster from `BackendMap::health_check_configs`; it now goes through `BackendMap::set_health_check_config(cluster_id, None)`, the path `AddCluster` takes, which resets every backend of the cluster to healthy and re-emits the availability gauges.

Every path that clears a health check:

- `RemoveHealthCheck`: fixed (drops in-flight probes, then resets the backends).
- `AddCluster` upsert without `health_check`: already reset the backends, but kept in-flight probes, whose own config copy (`record_check_result` uses `check.config`) could mark a backend DOWN after the reset. It now drops them too.
- `RemoveCluster`: removes the backends outright; unchanged (the reset is a no-op on a removed cluster, `record_cluster_availability` returns early).
- Master state replay: `ConfigState` holds no backend health and a fresh worker starts with healthy backends; a replayed `AddCluster` into a live worker takes the upsert path above.

## Tests

- `server::remove_health_check_tests::remove_health_check_resets_a_backend_marked_down`: red without the fix (backend stays DOWN), green with it.
- `server::remove_health_check_tests::add_cluster_without_health_check_resets_a_backend_marked_down`: guard for the upsert path, which already reset; red when the `set_health_check_config` call is removed from `Server::add_cluster`.
- e2e `health_check_mode_tests::test_remove_health_check_restores_down_backend`: two backends, one answering 404 on the probe path but 200 on traffic; waits until it is DOWN (`health_check.down == 1`) and excluded (10 consecutive requests to the other backend), sends `RemoveHealthCheck`, then requires a response from it. Two backends because a cluster with every backend down fails open. Without the fix: `the backend marked DOWN never served traffic after RemoveHealthCheck`; with it: ok.
- Not covered: dropping the in-flight probes on the upsert path (needs a live probe socket in flight).

Validation: `cargo +nightly fmt --check`, `cargo +1.93.1 clippy --all-features --all-targets --locked -- -D warnings`, `cargo +1.93.1 test -p sozu-lib --lib --all-features --locked` (1588 passed), the 11 `health_check` e2e tests, the full e2e suite (`--features opentelemetry,splice,simd -- --test-threads=4`: 622 passed), `check_doc_citations.py --base origin/main`.

## Interplay with #1809

#1809 (merged) rewrote the `health-check remove` paragraph of `doc/health_checks.md` to describe the behaviour this PR fixes. The merge of origin/main keeps this PR's wording (backends reset to healthy, in-flight probes dropped) and drops the clause of #1809's CHANGELOG entry that documented the old behaviour.

Fixes #1811





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