Skip to content

fix(state): roll back refused worker frontend orders - #1886

Merged
FlorentinDUBOIS merged 1 commit into
mainfrom
codex/fix-worker-command-rollback
Oct 14, 2026
Merged

FlorentinDUBOIS merged 1 commit into
mainfrom
codex/fix-worker-command-rollback

Conversation

@FlorentinDUBOIS

Copy link
Copy Markdown
Collaborator

The worker writes a request to its ConfigState before applying it to the live proxy. A frontend or listener addition, or a frontend removal, that the proxy then refuses could therefore remain in the worker state even though it never reached the runtime. The main process rolls back an all-worker refusal, so QueryClusterById could subsequently report a main/worker disagreement.

This change shares the request-only inverses between the main process and workers, snapshots the exact stored frontend before removals, and applies the compensating request on a worker runtime refusal. Rollback is armed only after the original state dispatch succeeds, so a rejected duplicate cannot erase a pre-existing object.

The scope is deliberately bounded. Upserts, listener updates, cluster removals, and certificate mutations still require distinct displaced-value or runtime snapshots. HTTP/HTTPS changes across several same-address listeners can also leave a pre-existing heterogeneous runtime partially changed if one listener refuses; this change restores ConfigState, not that runtime-only state.

Validation:

  • cargo +nightly fmt --all -- --check
  • cargo clippy --all-targets --locked -- -D warnings
  • cargo build --all-features --locked
  • cargo test --workspace --locked
  • Added HTTP/HTTPS/TCP/UDP tests for refused additions, exact removal restoration, duplicate frontend preservation, and duplicate listener preservation. The exact-removal test failed before the snapshot implementation and passes with it.
  • A replayable proxy-manager integration test against the published Sōzu 2.3.0 binary reproduces the main/worker disagreement; the same unmodified test passes against this branch's binary.

@FlorentinDUBOIS
FlorentinDUBOIS merged commit 093e438 into main Oct 14, 2026
37 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