Skip to content

Stabilisation prep — CHANGELOG, migration guide, CI matrix, docs sprint, e2e harness, #515 fix - #1236

Merged
FlorentinDUBOIS merged 15 commits into
mainfrom
feat/v2-week-1
May 2, 2026
Merged

FlorentinDUBOIS merged 15 commits into
mainfrom
feat/v2-week-1

Conversation

@FlorentinDUBOIS

@FlorentinDUBOIS FlorentinDUBOIS commented May 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Bundles seven low-to-medium-risk preparatory commits. The ordering is
intentional: documentation and CI infrastructure first, then the
security-sensitive #515 fix, then the format pass that proves
cargo +nightly fmt --check is clean.

Commit Subject Issues
16ccaa6 docs(upgrade): structural draft for the upgrade guide new doc/upgrade/1.x-to-2.0.md
70dc914 chore(changelog): collapse 3 Unreleased sections + drop emoji headers —
b414da8 ci(workflows): expand feature-coverage matrix —
1d96730 docs: address documentation sprint closes #1220, #1221, #1222, #1155
1fc60a2 test(e2e): document protocol-pair matrix harness + applicable cells —
76dd4f8 fix(bin): close hot-upgrade race against on-disk binary replacement closes #515
7515413 style: cargo +nightly fmt --all —

Why each commit

CHANGELOG normalisation

CHANGELOG.md previously carried three concurrent Unreleased
sections — ## [Unreleased] (main-scoped post-1.1.1 fixes from
PRs #1162, #1191, #1192, #1193, #1194, #1196, #1202, #1223),
## feat/answer-templates-rewrite-auth - Unreleased (answer
templates, URL rewrite, basic auth), and ## feat/h2-mux - Unreleased
(H2 multiplexer rewrite from PR #1209). All three feature stacks are
on main; the per-branch dividers were release-engineering staging
that no longer reflects current state.

The collapse drops the per-branch dividers (their bodies appear
under ## [Unreleased] with provenance markers), promotes the
breaking changes (proto-tag renumbers, dashboard metric renames,
http.errors labelling, pattern-trie regex anchoring, empty-val
del-header semantic, sub-16393 buffer_size rejection, cipher-list
constant rename) to a top-level ### Breaking changes paragraph at
the start of the section, and drops emoji from top-level subheaders
(🌟 → Added, 🔄 → Changed, ⛑️ → Fixed, ✍️ → Changed, 📚 →
Documentation, 🤖 → CI, ⚠️ → Behaviour-affecting). Per-commit-log
emoji at depth ≥ 4 is retained where it doesn't conflict with
Keep-a-Changelog vocabulary. Net +30 lines; historical release
entries (## 1.1.1, ## 1.1.0, …) preserved verbatim.

Migration guide

New file doc/upgrade/1.x-to-2.0.md (278 lines): pre-upgrade backup
checklist, eight numbered breaking changes with Action blocks
(proto-tag renumbers, dashboard renames, http.errors labelling,
pattern-trie regex anchoring, empty-val del-header semantic,
sub-16393 buffer_size rejection, cipher-list constant rename, new
TOML keys), roadmap asterisks (what's not in the upcoming major),
rollback procedure with explicit prohibition on loading
new-major-generated state files into the older binary, and
supported-versions table. Structural draft only; the augmentation
covering 302/308 redirect proto details lands alongside that change
in a follow-up.

CI feature-coverage matrix expansion

.github/workflows/ci.yml now exercises six feature-coverage cells
on the pinned 1.88.0 toolchain:

cell flags
msrv --features opentelemetry,splice,simd (keeps default jemallocator)
default-features `` (bare default; mirrors cargo install sozu)
crypto-ring --no-default-features --features crypto-ring,opentelemetry,splice,simd
crypto-aws-lc-rs --no-default-features --features crypto-aws-lc-rs,opentelemetry,splice,simd
crypto-openssl --no-default-features --features crypto-openssl,opentelemetry,splice,simd
fips --no-default-features --features fips,opentelemetry,splice,simd

Plus three toolchain-drift cells (stable, beta, nightly) unchanged.
Splice runtime path is now actually exercised in CI on every Linux
runner — previously only compiled when --all-features happened to
include it. The four crypto cells reflect what release artefacts
ship with (explicit feature list, never --all-features so
e2e-hooks cannot leak into a production binary).

Documentation sprint

Four documentation issues closed by content in this PR:

  • Underdocumented: https protocol listener and suitable frontend #1220 HTTPS listener pairing — new
    ## Frontend matching: pairing, precedence, and patterns section in
    doc/configure.md with a worked two-listener config example. A
    protocol = "https" listener terminates TLS at the boundary; the
    routed cluster declares protocol = "http" (TLS does not continue
    end-to-end yet — a separate enhancement tracked by h2: support TLS for backend (upstream) connections #1218).
  • Underdocumented: disallow send_proxy for http expect and http relay #1221 send_proxy is TCP-only — same section, explicit Action
    block. The flag is silently ignored on HTTP/HTTPS clusters; the
    documentation now matches the runtime.
  • Underdocumented: path match precedence #1222 Path-match precedence — same section, explicit ordering
    (EQUALS > anchored REGEX > longest-prefix PREFIX) + worked example
    for the reporter's /.well-known/acme-challenge vs / split
    (Stalwart + Apache shared host). Notes that Rust regex does not
    support look-around; decompose into PREFIX rules using
    longest-match precedence, or declare explicit EQUALS rules.
  • Document the unix.socket communication protocol #1155 unix-socket protocol — new file doc/protocol.md
    covering frame format (8-byte little-endian length-prefix
    including the prefix, protobuf body, max_buffer_size cap),
    authentication (SO_PEERCRED + command_allowed_uids),
    Request/Response shapes with worked examples in Python pseudocode
    and a pointer to the sozu-client Rust crate, lifecycle
    (request/response, server-push events via SubscribeEvents,
    master-worker fanout with PROCESSING status). The protobuf
    schema in command/src/command.proto remains the source of
    truth — this document covers operational discipline that is not
    in the schema itself. protoc-gen-doc auto-generation is a
    follow-up.

#1186 (sozu.io OpenTelemetry mention) is out of this repo's scope —
the in-repo OpenTelemetry docs already exist at
doc/configure.md ## OpenTelemetry (traceparent passthrough). The
issue should be closed with a comment redirecting the reporter to
the sozu.io repository.

E2E protocol-pair matrix harness

The four-cell (frontend H1/H2 + TLS × backend H1/H2c) matrix
harness already exists at
e2e/src/tests/tests.rs::try_tls_cardinality_cell (line 660). This
commit lands a discovery / applicable-cells reference document at
e2e/COVERAGE.md covering:

  • The 4-cell matrix (h1↔h1, h1↔h2c, h2↔h1, h2↔h2c) with the
    existing try_tls_cardinality_h{1,2}_h{1,2}_{rsa,ecdsa} wrappers.
  • The applicable-cells decision matrix (per-feature ✓/✗ across the
    4 cells) — RFC 9218 priority is H2-frontend only; HTTP/1
    pipelining is H1-frontend only; X-Real-IP trailer elision wants
    H2 frontend cells specifically for the trailer-frame regression.
  • Mock-backend taxonomy: AsyncBackend/SyncBackend/SingleRead*/
    ChunkedFlush* are H1-backend-only;
    H2Backend/RawH2ResponseBackend are h2c-only.
  • The priority-1 backfill list — six features that ship in the
    upcoming release notes and need cell coverage before the tag
    (Basic auth, 301 redirects, X-Real-IP, 429 limit,
    evict_on_queue_full, custom answer templates).

A protocol_pair_matrix!() macro to auto-generate per-cell wrappers
is documented as a future ergonomics improvement, not in this PR.
The actual backfill is a separate change.

#515 fexecve fix

bin/src/upgrade.rs:163 (master hot-upgrade) and
bin/src/worker.rs:333 (worker spawn / auto-restart) previously
called Command::new(executable_path).exec() where
executable_path was a string captured at master startup via
read_link(\"/proc/self/exe\"). If an operator replaced the on-disk
binary at that path between master startup and the exec call
(cp new-sozu /usr/bin/sozu followed by sozuctl upgrade, or a
worker auto-restart triggered after an in-place package upgrade),
execve(2) resolved the path string as a normal filesystem lookup
and started the new binary, incompatible with the running
master's protocol expectations.

The new helper bin/src/util.rs::get_executable_exec_path() opens
/proc/self/exe with O_PATH | O_CLOEXEC and returns
/proc/self/fd/<n> for execve(2) to resolve through the magic
symlink to the original inode the master was started from
(O_CLOEXEC closes the fd on successful exec; on failed exec the
fd persists harmlessly for the master's lifetime). Linux-only via
cfg(target_os = \"linux\"); FreeBSD / macOS keep the path-string
approach (out of scope for this fix). Both exec sites fail-soft on
O_PATH open failure (log + fall back to path-string exec).

Two new unit tests in bin/src/util.rs::tests cover the helper's
shape (get_executable_exec_path_returns_proc_self_fd_on_linux +
get_executable_exec_path_distinct_calls_yield_distinct_fds); both
pass. An e2e upgrade-race test (binary-replacement-during-upgrade
scenario) is a follow-up — it needs a side-binary built with
--features e2e-hooks that the harness can cp over
/proc/self/exe's symlink target mid-upgrade.

Format pass

cargo +nightly fmt --all applied to wrap the new doc-comment lines
in bin/src/util.rs. No code changes.

Verification batch — research only

Three issues need repro before close, none blocking this PR:

Validation

  • cargo build -p sozu --locked clean (verified locally before commit 76dd4f8)
  • cargo +nightly fmt --all -- --check clean after commit 7515413
  • cargo clippy --workspace --locked -- -D warnings clean (verified locally)
  • cargo test -p sozu --lib util::tests passes 2/2 (the new possible issue with panics when upgrading to a major version #515 unit tests)
  • Full cargo test --workspace --locked --all-features — pending CI
    (relies on the six-cell feature-coverage matrix to validate
    per-cell)
  • cargo test -p sozu-e2e -- --ignored fuzz — pending CI (fuzz
    cell)

Test plan

  • CI green on the new six-cell feature-coverage matrix (4 crypto
    cells with full features + MSRV + default-features baseline)
  • Soak window on the CleverCloud production fleet (7 days with a
    5-cluster baseline exercising new features) before the release
    tag — operational, not part of this PR
  • Human review of the migration guide and CHANGELOG
    normalisation — operator-facing wording
  • Code review of the possible issue with panics when upgrading to a major version #515 fix — security-sensitive
    (master/worker exec path); CODEOWNERS @FlorentinDUBOIS @Wonshtrum
    @llenotre

What's NOT in this PR

New file `doc/upgrade/1.x-to-2.0.md` — operator-facing migration guide
covering the breaking changes accumulated on `main` since v1.1.1.

Pre-upgrade checklist (mandatory backups), 8 numbered breaking changes
with `Action` blocks (proto-tag renumbers, dashboard metric renames,
http.errors labelling, pattern-trie regex anchoring, empty-val
del-header semantic, sub-16393 buffer_size rejection, cipher-list
constant rename, new TOML keys), v2.x roadmap asterisks, rollback
procedure with explicit prohibition on loading v2-generated state into
v1.1.x, and supported-versions section (v1.1.x EOL at v2.0.0 release).

This is the **structural draft** per `tasks/todo.md` §3.1.b. A follow-up
commit augments §6 with 302/308 redirect proto details once §3.2.e
lands in Week 2 (#1009).

Refs: tasks/todo.md §3.1.b; consolidated review CR2 (split structural
draft + augmentation), B5 (docs-as-code coupling — augmentation lands
with §3.2.e in same commit as code).

Signed-off-by: Florentin Dubois <[email protected]>
The CHANGELOG previously carried three concurrent Unreleased blocks —
`## [Unreleased]` (main-scoped post-1.1.1 fixes from PRs #1162, #1191, #1192,
#1193, #1194, #1196, #1202, #1223), `## feat/answer-templates-rewrite-auth -
Unreleased` (answer templates, URL rewrite, basic auth), and
`## feat/h2-mux - Unreleased` (the H2 multiplexer rewrite from PR #1209). All
three feature stacks are on `main`; the per-branch dividers were release-
engineering staging that no longer reflects current state.

Changes:
- Drop the `## feat/answer-templates-rewrite-auth - Unreleased` and
  `## feat/h2-mux - Unreleased` dividers; their bodies now appear under
  `## [Unreleased]` with provenance markers (`### Added — Answer templates / ...`,
  `### Added — H2 multiplexer (PR #1209)`).
- Promote the breaking changes (proto-tag renumbers, dashboard metric renames,
  `http.errors` labelling, pattern-trie regex anchoring, empty-val del-header
  semantic, sub-16393 `buffer_size` rejection, cipher-list constant rename) to
  a top-level `### Breaking changes (v1.1.x → v2.0.0)` paragraph at the top of
  the section so operators see them first.
- Drop emoji from top-level subheaders (🌟 → Added, 🔄 → Changed, ⛑️ → Fixed,
  ✍️ → Changed, 📚 → Documentation, 🤖 → CI, ⚠️ → Behaviour-affecting). Per-
  commit-log subsection at depth ≥ 4 keeps minor emoji ornaments where they
  don't conflict with Keep-a-Changelog vocabulary.
- Preserve historical release entries (`## 1.1.1`, `## 1.1.0`, …) verbatim;
  they are released and immutable.

Net effect: a single `## [Unreleased]` block ready for the v2.0.0 release-cut
in §3.4.c of `tasks/todo.md`. Future passes can de-duplicate the multiple
`### Added`/`### Changed`/`### Fixed` sub-blocks into one each per
Keep-a-Changelog strict shape; this commit is the structural collapse only.

Refs: tasks/todo.md §3.1.a; codex M12 amendment (3-way not 2-way collapse).
Signed-off-by: Florentin Dubois <[email protected]>
@FlorentinDUBOIS FlorentinDUBOIS changed the title v2.0.0 Week 1: stabilisation prep — CHANGELOG, migration guide, CI matrix, docs sprint, e2e harness, #515 fix Stabilisation prep — CHANGELOG, migration guide, CI matrix, docs sprint, e2e harness, #515 fix May 2, 2026
…ry + splice + simd cells

Modify `.github/workflows/ci.yml` so every crypto-provider cell AND the
MSRV cell exercise the full feature matrix (`<crypto>,opentelemetry,
splice,simd`), matching what release artefacts ship with (the published
Docker image build flags). Add a separate `default-features` baseline
cell to detect breakage when the optional features are off.

Cell layout (6 feature-coverage cells + 3 toolchain-drift cells = 9
total):

| cell             | toolchain | flags |
|------------------|-----------|-------|
| msrv             | 1.88.0    | `--features opentelemetry,splice,simd` (keeps default jemallocator) |
| default-features | 1.88.0    | `` (bare default; mirrors `cargo install sozu`) |
| crypto-ring      | 1.88.0    | `--no-default-features --features crypto-ring,opentelemetry,splice,simd` |
| crypto-aws-lc-rs | 1.88.0    | `--no-default-features --features crypto-aws-lc-rs,opentelemetry,splice,simd` |
| crypto-openssl   | 1.88.0    | `--no-default-features --features crypto-openssl,opentelemetry,splice,simd` |
| fips             | 1.88.0    | `--no-default-features --features fips,opentelemetry,splice,simd` |
| stable/beta/nightly | (drift) | `` (toolchain regression detection; unchanged) |

Splice is `cfg(all(target_os = "linux", feature = "splice"))`; the
Linux-only `ubuntu-latest` runner exercises the splice runtime path
(was previously compile-only via the lack of any splice cell).

The feature-coverage matrix lists 6 cells; toolchain drift remains 3.

Signed-off-by: Florentin Dubois <[email protected]>
Five docs issues from the 2026-04 evaluator wave (eshattow filed #1220
/ #1221 / #1222; shanduur filed #1155; yonas filed #1186 against the
sozu.io frontpage which is out of this repo's scope).

This commit closes 4 of the 5; #1186 needs a separate sozu.io PR and
will be commented on the issue tracker.

Changes:

`doc/configure.md` — new "## Frontend matching: pairing, precedence,
and patterns" section before "## Custom HTTP answer templates"
covering:

- **HTTPS listener pairing (#1220)**: `protocol = "https"` listener
  terminates TLS at the boundary; routed clusters declare
  `protocol = "http"` (TLS does not continue end-to-end in v2.0.0;
  `#1218` tracks backend TLS as a follow-up). Working two-listener
  config example included.
- **Path matching precedence (#1222)**: explicit ordering — EQUALS
  wins first, then anchored REGEX, then PREFIX with longest-match.
  Worked example for the
  `/.well-known/acme-challenge` vs `/` split that the reporter asked
  about (Stalwart + Apache shared host).
- **Regex limitations (#1222 follow-up)**: Rust `regex` does not
  support look-around (`(?!...)` etc); decompose into PREFIX rules
  using longest-match precedence, or declare explicit EQUALS rules.
  `fancy-regex` is not a dependency; tracked as discussion in #1222.
- **`send_proxy` / `expect_proxy` are TCP-only (#1221)**: HTTP/HTTPS
  clusters use forwarding HTTP headers (X-Forwarded-For, X-Real-IP,
  RFC 7239 Forwarded in a follow-up release). The flag is silently
  ignored on HTTP clusters; the reporter's expected `warn!` could be
  added in a follow-up but the documentation is the immediate fix.

`doc/protocol.md` — new file (#1155): wire-level reference for the
unix-socket command protocol. Covers framing (8-byte little-endian
length prefix INCLUDING the prefix, protobuf body, max_buffer_size
cap), authentication (`SO_PEERCRED` + `command_allowed_uids`),
message types (`Request` / `Response` with worked examples in
Python pseudocode + pointer to `sozu-command-lib`), and lifecycle
(request/response, server-push events via `SubscribeEvents`,
master-worker fanout with `PROCESSING` status). The protobuf schema
in `command/src/command.proto` remains the source of truth — this
document covers the operational discipline that is not in the
schema itself. `protoc-gen-doc` auto-generation remains a follow-up.

#1186 (sozu.io OpenTelemetry mention) — out of this repo's scope.
The repo-side OTel docs already exist at `doc/configure.md
"## OpenTelemetry (traceparent passthrough)"`. #1186 should be
closed with a comment redirecting the reporter to the sozu.io
repository.

Signed-off-by: Florentin Dubois <[email protected]>
The 4-cell `(frontend H1/H2 + TLS × backend H1/H2c)` matrix harness
already exists at `e2e/src/tests/tests.rs::try_tls_cardinality_cell`
(line 660). The harness should be **reused** (not invented from
scratch) and tests should opt into **applicable cells only**.

This commit lands a discovery / applicable-cells reference document
at `e2e/COVERAGE.md`. It covers:

- The 4-cell matrix (h1-h1, h1-h2c, h2-h1, h2-h2c) with the existing
  wrappers (`try_tls_cardinality_h{1,2}_h{1,2}_{rsa,ecdsa}`).
- The applicable-cells decision matrix (per-feature ✓/✗ across the 4
  cells) — RFC 9218 priority is H2-frontend only; HTTP/1 pipelining is
  H1-frontend only; X-Real-IP trailer elision wants H2 frontend cells
  for the trailer-frame regression specifically.
- Mock-backend taxonomy: `AsyncBackend`/`SyncBackend`/`SingleRead*`/
  `ChunkedFlush*` are H1-backend-only; `H2Backend`/`RawH2ResponseBackend`
  are h2c-only. Pairing wrong-protocol mocks with the wrong cell fails
  fast on the cluster's `http2` switch.
- v2.0.0 priority-1 backfill list — 6 features that ship in v2.0.0
  release notes and need cell coverage before the tag (Basic auth, 301
  redirects, X-Real-IP, `429` limit, `evict_on_queue_full`, custom
  answer templates).
- Backend-TLS expansion preview — once backend TLS lands (#1218), the
  helper's `backend_h2: bool` axis grows to a `BackendKind` variant
  and the matrix becomes 8 cells.
- Where the protocol matrix runs inside the CI feature-coverage
  matrix.

A future small commit should add a `protocol_pair_matrix!()` macro to
auto-generate per-cell wrappers for a feature; until then, hand-author
the wrappers following the existing shape. The macro is documented as
a future ergonomics improvement in COVERAGE.md but is **not** in this
commit.

The actual backfill (priority-1 features × applicable cells) is a
follow-up deliverable. This commit just makes the harness
discoverable and codifies the rule.

Signed-off-by: Florentin Dubois <[email protected]>
Closes #515.

The bug: `bin/src/upgrade.rs` (master hot-upgrade re-exec) and
`bin/src/worker.rs` (worker spawn / auto-restart) both called
`Command::new(executable_path).exec()` where `executable_path` was
the string `read_link("/proc/self/exe")` captured at master startup.
If an operator replaced the on-disk binary at that path between
master startup and the exec call (`cp new-sozu /usr/bin/sozu`
followed by `sozuctl upgrade`, or a worker auto-restart triggered
after an in-place package upgrade), `execve(2)` resolved the path
string as a normal filesystem lookup and started the **new** binary,
which is incompatible with the running master's protocol expectations
— the race produced crashes, partial state, or refusals to handshake.

The fix: a new helper `bin/src/util.rs::get_executable_exec_path()`
opens `/proc/self/exe` with `O_PATH | O_CLOEXEC` and returns
`/proc/self/fd/<n>` for `execve(2)` to resolve through the magic
symlink to the **original** inode the master was started from.

Why this works: `/proc/self/exe` is a magic symlink that always
resolves to the inode the kernel mapped at process start, regardless
of whether the on-disk file was unlinked or replaced afterwards.
`O_PATH` returns an fd that pins that inode for the lifetime of the
fd. Passing `/proc/self/fd/<n>` to `execve(2)` causes the kernel to
resolve through the magic symlink to that pinned inode — race-free
against `cp new-sozu /usr/bin/sozu`. After fork, the child inherits
the parent's mmap'd image, so opening `/proc/self/exe` in the
forked child also gets the original inode.

Lifecycle: the fd is leaked (`OwnedFd::into_raw_fd`) — it must stay
open across `exec(2)`. `O_CLOEXEC` closes it on successful exec; on
failed exec the fd persists for the rest of the master's lifetime,
which is acceptable on a master-in-trouble code path.

Platform scope: Linux-only via `cfg(target_os = "linux")`. FreeBSD
and macOS keep the historical path-string approach because
`/proc/self/exe` is not portable. The race window on those
platforms is unchanged from v1.x — out of scope for #515 / v2.0.0
(the v2.0.0 migration target is Linux operators).

Failure handling: both exec sites fail-soft on `O_PATH` open
failure — log an `error!` and fall back to the path-string capture.
That preserves v1.x behaviour as a worst-case (which is what we
shipped before this fix).

Test coverage:
- Two new unit tests in `bin/src/util.rs::tests` covering the
  helper's shape: `get_executable_exec_path_returns_proc_self_fd_on_linux`
  asserts the path matches `/proc/self/fd/<n>` and the fd resolves
  to a regular file via `std::fs::metadata` (which follows the
  magic symlink to the original inode);
  `get_executable_exec_path_distinct_calls_yield_distinct_fds`
  asserts each call opens a fresh fd (the leak-on-exec model means
  one fd per exec attempt, not multiplexed).
- An e2e upgrade-race test in
  `e2e/src/tests/upgrade_race_tests.rs` covering the actual
  binary-replacement-during-upgrade scenario is a follow-up commit
  (the test needs a side-binary built with `--features e2e-hooks`
  that the harness can `cp` over `/proc/self/exe`'s symlink target
  mid-upgrade — non-trivial; tracked in
  tasks/todo.md §3.2.h v2.0.0 follow-up).

CHANGELOG `### Security` entry added.

Refs: tasks/todo.md §3.1.c (corrected file paths per consolidated
review CR1: real exec sites are `bin/src/upgrade.rs:163` and
`bin/src/worker.rs:333`, not `command/mod.rs:78`); CLAUDE.md §0
prologue (no panic on network-facing input — fail-soft on
`O_PATH` open failure); §0 prologue (e2e regression coverage
mandatory — partial here via unit tests, e2e upgrade-race test
tracked as follow-up because of the harness work it needs);
project memory `feedback_sozu_log_macros_no_capture.md`
(explicit format args in `error!` calls — capture syntax does
not work).

Signed-off-by: Florentin Dubois <[email protected]>
Signed-off-by: Florentin Dubois <[email protected]>
…uide

Five fixups in one pass:

1. **Move `doc/upgrade/1.x-to-2.0.md` to its intended path.** A prior
   commit accidentally landed it under
   `.claude/worktrees/docs-migration-1x-to-2.0/doc/upgrade/1.x-to-2.0.md`
   (a global gitignore on `.claude/` plus a relative-path resolution
   confusion in `git worktree add`). The file is now at
   `doc/upgrade/1.x-to-2.0.md` where it can actually be opened by
   operators following the link from the CHANGELOG breaking-changes
   paragraph.

2. **Drop the "Proto field renumbering for health-check carriers"
   line from the CHANGELOG breaking-changes paragraph.** Those tag
   numbers only existed on the unreleased PR #1191 development
   branch; they are not on any released 1.x tag, so the renumber is
   internal to the development line, not a 1.1.x → 2.0.0 break for
   operators consuming a release binary. The CHANGELOG body still
   carries the same fact in the "Changed" subsection where it
   correctly describes the renumber as affecting operators upgrading
   from PR #1191 development builds, not from a 1.x release.

3. **Drop CleverCloud-affiliated project name references** from the
   docs added in this branch (`doc/upgrade/1.x-to-2.0.md`,
   `doc/protocol.md`, `e2e/COVERAGE.md`). The protocol document
   previously listed example client crates by name; it now describes
   the protocol generically and points to `sozu-command-lib` as the
   canonical Rust API surface (which is in-tree, not a separate
   project). Pre-existing references in the historical CHANGELOG
   release entries are left as-is — those are released, immutable
   text.

4. **Drop "week N" / version-specific roadmap labels and internal
   plan-section references** from the same docs. The migration guide
   no longer prefaces the roadmap as "v2.1.0" / "v2.2.0" / "v3.0.0";
   each row reads "follow-up release" or "future" with the issue
   reference for tracking. `e2e/COVERAGE.md` now describes the
   priority-1 backfill list as "follow-up commit" instead of "Week 2
   deliverable" and refers to the in-repo CI workflow file directly.
   `doc/protocol.md` no longer references the internal plan file
   `tasks/todo.md` or its section identifiers.

5. **Add `opentelemetry` and `simd` feature pass-throughs to
   `e2e/Cargo.toml`.** The CI matrix expansion in commit b414da8
   started passing `--features <crypto>,opentelemetry,splice,simd`
   to every `cargo test -p sozu-e2e` invocation, but
   `sozu-e2e/Cargo.toml` only declared `splice` and the crypto
   features. Cargo failed fast with "Package `sozu-e2e` does not
   have feature `opentelemetry`" before any test ran. The two
   pass-throughs forward to `sozu-lib` (where the features actually
   take effect); the e2e suite itself does not observe behaviour
   differences. Verified locally with
   `cargo build -p sozu-e2e --no-default-features
   --features crypto-ring,opentelemetry,splice,simd --locked`.

The build / clippy / unit-test gates remain clean. The CI matrix
should now pass on the four crypto cells + the MSRV cell + the
default-features baseline.

Signed-off-by: Florentin Dubois <[email protected]>
The previous #515 commit (76dd4f8) applied the fd-based exec helper
to BOTH `bin/src/upgrade.rs:163` (master hot-upgrade) and
`bin/src/worker.rs:333` (worker auto-restart). That was wrong for the
hot-upgrade site — the operator's whole point in running
`sozuctl upgrade-main` after `cp new-sozu /usr/bin/sozu` is to switch
to the new on-disk binary. With the earlier fix in place, the
hot-upgrade child would re-exec the **original** inode (race-free
against the on-disk replacement), defeating the operator's intent.

The two sites have different intents:

- Worker auto-restart MUST match the running master's version. A
  worker at a different proto schema than the master crashes the
  fan-out. Race-free fd-based exec is correct here. (Geal's original
  2018 #515 description was specifically this case.)
- Master hot-upgrade SHOULD switch to the new binary by design. The
  operator triggers it deliberately. Path-based exec is correct here.

Changes:
- `bin/src/upgrade.rs:163` reverts to `Command::new(executable_path)`
  with an in-source comment explaining why this site DOES NOT use the
  fd-based helper. The error fail-soft branch and its `error!` log
  go away — there is nothing to fail-soft against on the path-based
  re-exec.
- `bin/src/util.rs::get_executable_exec_path()` rustdoc rewritten with
  an explicit two-row table of "use this helper here / not there",
  pointing at the worker site as the only call site.
- `CHANGELOG.md` entry retitled "Worker auto-restart race against
  on-disk binary replacement" (previously "Hot-upgrade race ..."),
  scope narrowed, and a sentence added clarifying the master
  hot-upgrade path is unchanged.
- `doc/upgrade/1.x-to-2.0.md` gains a "How sōzu upgrades — two
  distinct paths" section so operators understand the difference
  between master hot-upgrade (operator-triggered, by-path,
  intentionally switches versions) and worker auto-restart
  (master-triggered, by-fd, race-free against on-disk replacement).

Build + lib unit tests + e2e fmt clean. The two new
`util::tests::get_executable_exec_path_*` unit tests still pass; they
exercise the helper itself, which is unchanged.

Signed-off-by: Florentin Dubois <[email protected]>
Apply Prettier 3.8.3 (default config — no project-level .prettierrc)
to the three markdown files this branch creates:

- doc/upgrade/1.x-to-2.0.md
- doc/protocol.md (already-conformant; no diff)
- e2e/COVERAGE.md

The change is purely whitespace and table column alignment —
content is unchanged, the link/anchor structure is preserved.

`prettier --check` is now clean on all three files. The pre-existing
files I edited (`CHANGELOG.md`, `doc/configure.md`) are intentionally
NOT reformatted — they carry historical content (released changelog
entries, long-standing operator docs) that should not be churned by
a style pass scoped to this branch's additions.

Signed-off-by: Florentin Dubois <[email protected]>
`COVERAGE.md` previously labelled the `protocol_pair_matrix!` macro and
the priority-1 backfill table as "to be added" / "follow-up commit".
Both now land in `e2e/src/tests/protocol_pair_matrix.rs`:

- The macro emits four `pub fn try_<name>_<cell>()` wrappers plus their
  matching `#[test] fn test_<name>_<cell>()` harnesses for a feature
  cell function of the shape `fn try_<name>_cell(frontend_h2: bool,
  backend_h2: bool) -> State`. Identifier concatenation uses the
  `paste` crate (added as a dev-dependency).
- 16 cell tests across 4 features × 4 (frontend × backend) cells:
  basic auth (3-arm: missing header → 401, wrong creds → 401, correct
  creds → 200), 301 `RedirectPolicy::Permanent` redirect, custom 503
  answer template (verified via load-bearing `X-Sozu-Stamp` header
  the listener default does not emit), X-Real-IP elide+send on
  initial HEADERS (H2-backend cells assert the spoofed `1.2.3.4` is
  stripped and the proxy substitute `127.0.0.1` reaches the backend).
- Per-IP `429` and `evict_on_queue_full` are deferred from matrix
  coverage. Their existing single-cell tests in
  `cluster_ip_limit_tests.rs` and `eviction_tests.rs` exercise the
  policy logic; matrix coverage needs sustained TLS+H2 connection
  holds while a second connection races, which the current Hyper
  client pool does not expose. Documented in COVERAGE.md.

Backend-address rule for cell setup: `create_local_address()` keeps the
port bound via the port registry, so a backend mock that never starts
would still complete the TCP handshake when sōzu connects — masking
the answer-engine path. The redirect and 503 cells therefore call
`create_unbound_local_address()` so the connect attempt is RST'd and
the answer template fires; the basic-auth and X-Real-IP cells start a
real backend and use `create_local_address()`.

All 16 cells pass in parallel under 1 s on a developer laptop.

Signed-off-by: Florentin Dubois <[email protected]>
The Unreleased section was previously stripped of emoji prefixes and
carried per-branch suffixes (`### Added — Answer templates / URL
rewrite / Basic auth`, `### Added — H2 multiplexer (PR #1209)`, etc.)
left over from the three-way Unreleased collapse. Those suffixes
encode pre-tag development-line provenance — the changelog spans
released tags, not branches, so they are removed and the headers fall
back to plain Keep-a-Changelog categories with the emoji conventions
the rest of the file uses (🌟 Added, 🔄 Changed, ⛑️ Fixed, 🔐 Security,
💥 Breaking changes, 📚 Documentation, 🤖 CI). Also drops:

- The `### ⚠️ Behaviour-affecting (already in §Breaking changes above)`
  block — its two bullets duplicate Breaking changes verbatim per the
  header itself.
- The "Proto field renumbering for the health-check carriers" paragraph
  in Breaking changes plus the matching bullet in Changed — those tags
  only existed on an unreleased PR branch and never appeared on a
  released 1.x tag, so operators upgrading from a released 1.1.x
  binary do not see them.

Multiple `### 🌟 Added` / `### 🔄 Changed` / `### ⛑️ Fixed` blocks now
appear in sequence within Unreleased; bullets stay where they were
authored and will be merged into a single block per category at tag
time. The preamble paragraph is updated to flag this provisional
shape.

Signed-off-by: Florentin Dubois <[email protected]>
…idiom + schema-mismatch note

Three small corrections clustered around the worker auto-restart
fexecve fix:

- `bin/src/util.rs::get_executable_exec_path()` rustdoc claimed the
  fd "persists harmlessly for the rest of the master's lifetime" on
  failed exec. That is wrong: the helper is called inside the forked
  child immediately before `execve(2)` (see `bin/src/worker.rs:328`),
  not in the master. On failed exec the child returns
  `Err(WorkerError::SpawnChild(err))` (`bin/src/worker.rs:356`) and
  the worker spawn aborts, so the fd cannot accumulate across spawn
  attempts. Rustdoc and the inline comment are now consistent with
  this. The unit-test rustdoc no longer references a future
  `e2e/src/tests/upgrade_race_tests.rs` that was never created — the
  race-free property follows from kernel-tested
  `/proc/self/exe` magic-symlink semantics, and the unit test
  asserts only the helper's shape.

- `bin/src/worker.rs:336` used `executable_path.clone()` in the
  fallback path. Replaced with `executable_path.to_owned()` per the
  project's `&str → String` ownership convention.

- `bin/src/upgrade.rs` master hot-upgrade comment block now also
  spells out the operator-driven schema-mismatch concern (new
  binary's proto schema incompatible with the running master's
  `UpgradeData` JSON payload): the newly-execed master will fail to
  parse the inherited state and the upgrade aborts cleanly. Operators
  must verify proto compatibility before swapping the on-disk binary.

Signed-off-by: Florentin Dubois <[email protected]>
- `doc/upgrade/1.x-to-2.0.md` worker auto-restart section now states
  that `/proc/self/exe` is opened with `O_PATH` **in the forked child
  immediately before `execve(2)`**, not "at master startup". Adds a
  fallback subsection for operators in containers with masked `/proc`
  / AppArmor / SELinux profiles denying `r /proc/self/exe`: the
  worker logs `falling back to path-based exec` and the #515 race
  window reverts to its 1.1.x shape on every fallback. Adds a brief
  "race-freedom assertion" note pointing at the kernel-tested
  `/proc/self/exe` magic-symlink semantics + the in-tree unit tests.

- `CLAUDE.md` Feature flags table now lists `crypto-ring`,
  `crypto-aws-lc-rs`, `crypto-openssl`, and `fips` rows with the
  precedence chain `fips > ring > aws-lc-rs > openssl`, matching what
  `bin/Cargo.toml` + `lib/Cargo.toml` actually expose. The stale "doc
  is stale, fix the doc instead" sentence is replaced with a forward
  pointer to where the features live and a note that CI exercises
  all four cells.

- `doc/getting_started.md`'s "Cargo features" preamble previously
  claimed "there is no provider-pluggable surface today — the build
  links exactly one backend"; it now points at the
  `Choosing a crypto provider` section already documented further
  down (which already covers the four providers correctly).

- `e2e/COVERAGE.md` X-Real-IP row in the applicable-cells matrix
  marks h1-h1 and h2-h1 as `(✓)` (frontend-forwarding-only) because
  `AsyncBackend` does not expose request bytes — the strip/inject
  assertion only fires on H2-backend cells. Drops the duplicate
  `RawH2ResponseBackend` row that was repeated for "✗-symmetry";
  drops the `(codex MED-2 — applicable cells only)` parenthetical
  from the Mock backend taxonomy heading.

- `doc/protocol.md` "Related" link to `doc/upgrade/1.x-to-2.0.md` no
  longer advertises a "proto-tag renumbers" anchor (those tag shifts
  only happened on an unreleased branch and never landed on a 1.x
  tag, so they are not part of the 1.1.x → 2.0.0 migration); link
  text now reads "migration guide".

Signed-off-by: Florentin Dubois <[email protected]>
The pipeline matrix had two MSRV-toolchain cells named ambiguously:
`msrv` (which actually exercised the FULL feature matrix
`opentelemetry,splice,simd` on top of `jemallocator + crypto-ring`)
and `default-features` (which exercised the bare workspace defaults
only). The names didn't reflect what each cell actually covers, and
the pair both run on `1.88.0` so calling one "msrv" implied the other
wasn't.

Renames:

- `msrv` → `msrv-full` (full feature matrix on the MSRV toolchain).
- `default-features` → `msrv-bare` (workspace defaults only on MSRV).

Three `if: matrix.cell == 'msrv'` gates (nightly rustfmt install,
fmt check, doc build) update to `'msrv-full'` so the workspace-wide
fmt + doc steps still run exactly once per push. Comment block
clarifies the trade-off (`cargo install sozu`-shape vs. release
artefact-shape coverage).

Also drops the `(Q16: Docker image build flags)` audit-doc anchor
from the comment introducing the four crypto cells; the explanation
now reads "matches the feature flags the published Docker image is
built with" without the internal numbering.

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.

Underdocumented: https protocol listener and suitable frontend possible issue with panics when upgrading to a major version

1 participant