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
fix(queue): circuit breaker on NATS/queue backend (sweep #2) (#42)
Queue/NATS was the only provisioner backend with no circuit breaker: a
wedged shared-NATS account/JWT call (or a kube-apiserver stall on the
dedicated path) could pile up with no fast-fail and no /readyz signal,
unlike postgres/redis/mongo which all trip after 5 consecutive failures.
Add a QueueAdmin breaker (BackendQueueAdmin = "queue_admin"), a
breakerForQueue(useDedicated) helper (shared → QueueAdmin, dedicated →
K8sAPI, mirroring breakerForMongo), and wrap all 4 queue dispatch sites
(Provision shared + dedicated, Deprovision shared + dedicated) in
callBackend/callBackendVoid. Register QueueAdmin in collectBreakerInspectors
so a tripped queue breaker surfaces as backend_queue_admin on /readyz.
Tests: TestServer_QueueCircuitTripsOnRepeatedFailures (5 failures trip the
breaker; 6th short-circuits to Unavailable WITHOUT invoking the backend,
asserted via a call counter). The two registry-drift guards
(TestBreakers_EveryStructFieldHasAnInspector, _AllBackendsSurfaced) caught
the new breaker and are updated — they enforce that a new breaker is wired
into BOTH the inspector slice and /readyz. Full `go test ./... -short` green.
Co-authored-by: Manas Srivastava <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments