bug: nack() is never called — transient handler failures silently drop events #3
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
WorkerService::dispatch()always callsack()after running all handlers, even when a handler returns an error. Thenack()method is fully implemented in all queue adapters (sqlite, postgres, nats) with exponential backoff and dead-letter support, but it is never called anywhere.Result: if a handler fails transiently (TMDB down, search index unavailable, etc.), the event is consumed and lost — no retry.
Root cause
crates/application/src/worker.rsdispatch():Complication
The worker uses a fan-out model — every event is dispatched to all handlers. Naively nacking on any handler error would re-run all handlers, causing duplicate processing on the ones that already succeeded. Handlers would need to be idempotent for this to be safe.
Options
Affected files
crates/application/src/worker.rscrates/adapters/sqlite-event-queue/src/lib.rs(nack implemented but unused)crates/adapters/postgres-event-queue/src/lib.rs(same)crates/adapters/nats/src/consumer.rs(same)