Skip to content

Clear sticky-session state when reusing an HTTP/1 keep-alive slot #1822

Closed

Description

@FlorentinDUBOIS

HttpContext::reset prepares a reused H1 slot but leaves sticky_session intact (reset). Backend selection writes a new value only when the selected frontend is sticky (router), while response editing emits Set-Cookie for any retained value (editor).

The real candidate binary was exercised with one verified frontend connection:

  • a fresh request to non-sticky B returned body b and no cookie;
  • reused request A to sticky A returned SOZUBALANCEID=sticky-a;
  • reused request B reached B and returned body b, but also returned A's cookie.

The request is routed to B; the confirmed defect is stale response policy state and a wrong affinity cookie for B.

Focused test prepared during the audit (not yet published on main):

CARGO_BUILD_JOBS=4 mise exec [email protected] -- cargo test -p sozu-lib --features opentelemetry protocol::kawa_h1::editor::tests::test_reset_clears_every_request_scoped_routing_value -- --exact --nocapture

That broad test is red, but the fix and permanent regression should first pin the verified sticky_session path: sticky A → non-sticky B on one keep-alive connection must not emit A's cookie on B. Other surviving fields need separate path-specific oracles before being claimed as user-visible defects.

Evidence scope: runtime checks used 8ed38435c6e80dc374de421116d8b145f1e5ce6a; the relevant production paths were independently checked at bd19a78e2831fa9b3bc099eff96359f1bd457958 on 2026-10-03. This issue tracks lifecycle behavior and regression coverage.

Activity

  1. added a commit that references this issue on Oct 4, 2026
    f8dddbb
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