Repository navigation
Session protection proofs own their HTTP channel - #876
Merged
Merged
Conversation
Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
Lifetime transport allocation uses the caller deadline. Statement admission retains its existing wait and all four transport units remain bounded. Signed-off-by: zlareb1 <[email protected]>
This was referenced Nov 18, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #871
Changelog category
Changelog entry
Session-protection proofs use a private HTTP channel so pooled requests do not distribute one named session across different connections.
Why
A named HTTP session belongs to one backend. Pinning the shared driver and its generation still allows consecutive proof statements to use different connections. A checked statement can then refuse with
SESSION_NOT_FOUNDeven though the original session remains on another backend.Each proof owns a client with a one-connection pool, created from the original endpoint, database and principal configuration. This keeps consecutive statements on one reusable transport when the connection remains open. Backend attestation and checked-session validation still reject discontinuity; a replacement session is never accepted.
Scope and risk
The existing four-unit streaming-connection budget bounds private channels. Waiting for this lifetime capacity consumes the caller's remaining five-second proof deadline. The configured per-statement pool-admission cutoff (500 ms by default) does not govern that lifetime wait. Each statement retains ordinary pool admission and its class deadline, including the advisory schema refresh. Ordinary traffic continues on the shared driver. An unsuccessful or cancelled proof force-closes its owned channel; normal completion closes it before releasing capacity.
The query retry budget is zero for the private channel. The driver's internal network retry behavior remains, so backend and checked-session validation remain necessary. The existing proof deadline, authentication rules, backend identity, nonce checks and refusal behavior are unchanged.
The branch also contains the merged ordering-test fixture repair linked above. Its source matches main; product batching and the callers' assertions are unchanged.
Compatibility, rollout and rollback
Tests
SESSION_NOT_FOUNDbefore the fix and pass after it.pytest -q tests/unit/test_ch_coordination_session.py tests/unit/test_ch_coordination_transport.py: all 31 directly related cases passed. These cover session validation, admission, cancellation, cleanup, shared traffic and ordinary connect settings.mypy server/core/ch.pypassed before the queue-only correction; scoped Ruff checks, format checks andgit diff --checkpassed afterward.AI assistance in the code
AI-generated: Codex wrote most of the diff. Checked session validation, resource accounting, cancellation, unchanged proof controls and the causal regression results.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist