Skip to content

state: a rejected listener patch is partially applied in the main state #1703

Closed

Description

@FlorentinDUBOIS

Found during #1694. Measured on main at 9e55ad621db2a4f738f7a0ec54401f7f8e3e8291.

ConfigState::update_http_listener, update_https_listener and update_tcp_listener (command/src/state.rs) apply a listener patch field by field on the stored listener and validate some fields in between (e.g. sozu_id_header, forwarded_headers, H2 flood knobs, ALPN). When a validation fails partway through, the function returns an error but the fields written before the failing one stay applied in the main process state.

Effect: a rejected Update*ListenerConfig can leave the main state partially updated, while workers either applied nothing or applied the whole patch (depending on their own validation order) — main and workers can disagree, and listener list, SaveState and upgrade replay then reflect a configuration nobody asked for.

Fix: validate the whole patch first, then apply it (or apply to a clone and swap on success), in all three functions; keep the worker side consistent (same all-or-nothing semantics). Tests: a patch whose last field is invalid leaves the stored listener byte-identical; the error is returned; the worker rejects it the same way.

Activity

  1. added a commit that references this issue on Sep 30, 2026
    7095442
  2. added a commit that references this issue on Sep 30, 2026
    9d78850
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions