Skip to main content
← Back to list
01Issue
BugOpenSwamp ClubPublic
AssigneesNone

Relationships

#3994 Five Mongo queues can hand the same row to two replicas

Opened by skunk-ape · 10/26/2026

Problem

Five Mongo queues claim work by a find followed by a separate updateMany that marks the rows processing. Every replica runs their watchers, so two replicas that poll between each other's find and updateMany both take the same rows.

  • lib/infrastructure/mongo-feed-judge-queue.ts
  • lib/infrastructure/mongo-attio-sync-queue.ts
  • lib/infrastructure/mongo-resend-contact-queue.ts
  • lib/infrastructure/mongo-system-message-queue.ts
  • lib/infrastructure/mongo-returning-trial-queue.ts

Depending on the queue, a duplicate claim judges a feed submission twice, syncs a CRM record twice, or sends a message or email twice.

Expected

Each row is claimed by exactly one replica: one findOneAndUpdate per row, as mongo-inbox-email-queue.ts claimPending already does, keeping the 5 minute stale-processing reclaim. Check each queue's batch size against that window: a batch claimed at once but processed serially can outlast it and be reclaimed while still queued in memory.

Found while triaging swamp-club#3979, which fixes the same race in the extension scoring queue.

02Bog Flow
◉OPEN○TRIAGED○IN PROGRESS○SHIPPED

Open

10/26/2026, 11:50:17 PM

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.