Menu

I SIGKILLed 160 Node workers to find out which idempotency pattern double-charges
📰

I SIGKILLed 160 Node workers to find out which idempotency pattern double-charges

DEV Community: redis·Krrish Kumar·12 days ago
#IAFnREpl
#devtoredis#devto#dev#once#effect
Long article (1174 words) — no AI summary yet.
Reading 0:00
15s threshold

Queues retry. That is their job. BullMQ hands a stalled job to another worker. An agent framework replays a tool call after a timeout. A process dies in the gap between sending the email and writing down that it sent it. Every one of those is a chance to charge a card twice, or to never charge it at all and never find out.

Most retry guards I see in Node code are one of two patterns. I wanted to know how they behave when a worker is actually killed, not when it politely throws an error. So I built a crash lab, and a small library called claim-once that is the last row in every scenario below.

The setup

The lab starts real Node processes against a real Redis and kills them with SIGKILL at chosen points. The side effect appends a line to a file, so a kill cannot undo an effect that already happened. Counting lines gives the true number of effects.

The run below used 20 operations per scenario, 8 concurrent runners, a 400 ms lease, Redis 8.10 on Linux and Node 24.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.