You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(consumergate): runtime stop/start of queue controllers + deterministic e2e cancel test
Implement doc/rfc/consumer-gate.md:
- platform/extension/consumergate: extension contract — Gate, a single
blocking Wait the consumer consults per delivery (implementations own the
wait mechanism, so a notification-capable store can release instantly, and
the parked-delivery observation records), Admin (write surface for tests
and tooling), Config, Factory interface, and gomock mocks.
- platform/extension/consumergate/file: polling implementation — gate state
as plain files in a shared directory (gate file present = closed, rm =
open), parked-delivery records as JSON stamped parked/released by the
store, per-partition cached verdicts (TTL = poll interval) so an open gate
costs no stat per message, and temp-file-plus-rename writes with converged
error handling.
- platform/extension/consumergate/noop: no-op gate for services and tests
that do not need runtime gating.
- platform/consumer: consumer.New takes the Gate as a required argument and
consults it before each delivery. While a delivery is blocked the consumer
keeps it in-flight by periodically extending visibility (no retry budget
burned, partition order preserved). Shutdown while blocked leaves the
delivery for normal redelivery; gate errors fail open with a log and
counter.
- Wiring: gateway, orchestrator (primary + DLQ), and runway construct the
file-backed gate rooted at CONSUMER_GATE_DIR, defaulting to
/var/submitqueue/consumergate — the path the compose stack bind-mounts
into every service; stovepipe wires the no-op gate.
- test/e2e/submitqueue: replace TestCancel_RecordsIntent with
TestCancel_CaughtPreBatch_NeverLands — the stop→observe→start scenario from
the RFC. The gate parks runway's merge-conflict check for the test queue's
partition before landing, the parked record proves the request is held
pre-batch, the cancel drives it terminal cancelled, and after the gate
opens a sentinel request landing on the same partitions proves the stale
check signal was consumed and dropped — the cancelled change is never
batched and never lands.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments