mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
* fix(sqs): make per-queue message operations atomic with GuardedMessageQueue Introduce GuardedMessageQueue to wrap the per-queue message list with a ReentrantLock, eliminating race conditions where concurrent receiveMessage calls could both see the same message as visible and return it as a duplicate delivery. All message operations (send, receive, delete, change visibility, purge, move) now acquire the lock before touching the list, and persistence runs inside the lock boundary for consistent snapshots. * fix(sqs): defer DLQ candidate removal until destination resolves Review found that claimVisibleMessages eagerly removed DLQ candidates from the source queue before SqsService verified the DLQ ARN was resolvable. An invalid ARN would silently drop messages. Now candidates stay in the source queue until routing succeeds, matching prior behavior. * fix(sqs): address PR review comments - Expand wildcard imports to explicit in test file - Wrap executor lifecycle in try/finally with shutdownNow to prevent thread leaks on test failure - Add closed flag to GuardedMessageQueue so persist() becomes a no-op after deleteQueue, preventing resurrection of deleted queue state