Repository navigation
Add bounded PostgreSQL cleanup custody - #30
Merged
theboringhumane merged 2 commits intoOct 9, 2026
Merged
theboringhumane merged 2 commits into
theboringhumane merged 2 commits into
Conversation
Signed-off-by: theboringhumane <me@iamharsh.dev>
…tion Signed-off-by: theboringhumane <me@iamharsh.dev>
theboringhumane
merged commit Oct 9, 2026
03cb66d
into
feature/postgres-cleanup-authority
1 check passed
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.
A canceled query can lose its DATA lease before its database cancellation reaches the source. Add an opt-in accepted-parent registry and a separate bounded PostgreSQL cleanup tunnel. Receipts are returned only after pairing, a refreshed lease and physical stream registration. Cleanup checks the same parent, worker certificate, source/token/control-owner fences and a fixed live cleanup lease, then consumes the parent and ticket once.
Worker-to-source DATA stops permanently during cleanup. A positive cleanup lease permits at most 256 KiB of source-to-worker completion bytes for the trusted adapter to inspect and discard. Cleanup retains original source TLS and is capped at five seconds and 256 KiB in each direction. Rabbit cannot inspect the PostgreSQL protocol inside TLS; the trusted parent owns the typed encoder and must never give the cleanup connection to an untrusted child. CONNECT admission or CancelRequest EOF does not prove backend termination.
Disabled unless an operator supplies a separate receipt signing key and cleanup-authority URL. Existing clients remain unchanged. Network errors, hard revocations, missing receipts, busy writes and ambiguous state fail closed.
Validation: full transport and server package suites passed with the race detector on Azure. Tests cover closed parents, replay, current-source denial, cancellation before receipt registration, receive-only bounds, absent cleanup authority and joined shutdown. Paired source-TLS and queued-job backend-cancellation acceptance remains pending; no production activation.