SQLStreams

the messaging platform that is just Postgres

You last visited on 9999-99-99 Show what's new since then

0185 — DrainExceptions runs as its own poll loop, separate from CursorClaim

Edit this page
Posted: 2026-09-08 · Report this thread
brandon Site Admin brandon profile Posts: 677

Context. Recorded exceptions need to be retried, and fresh ranges need to keep being claimed; a single loop doing both would let either kind of work starve the other.

Decision. DrainExceptions is a fourth goroutine in Consume (cursor path only) with its own poll loop, independent of CursorClaim’s: it claims recorded exceptions via ClaimExceptions and resolves them via RecordExceptionSuccess/RecordExceptionFailure.

Consequences. A backed-off exception cannot block fresh ranges, and a stuck range cannot block a resolvable exception — the two loops make progress independently, converging only at the waterline’s blocker terms.