The Message That Was Delivered Twice Because It Was Slow

Read what each party saw, commit to a cause, and only then find out which of them was right. The root cause, why the obvious reading was wrong, and the fixes are all held back until you have answered.

The symptom

What was reported, before anyone knew what was happening.

A video-transcoding queue produced two output files for 4% of jobs, always the longest ones. Both workers logged a successful transcode. The queue’s delivery mode is "at-least-once" and the team believed duplicates would only occur on worker crashes, which had not happened.

What each party saw, and what each concluded

The evidence, in the form it actually arrived in — several parties, several partial views, several confident conclusions.

WhoWhat they could actually seeWhat they concludedVerdict
Worker 1A message received at 10:00:00 with a 5-minute visibility timeout. Transcoding a 40-minute video took 7 minutes. Deleted the message at 10:07 successfully.I processed this message and removed it.✕ wrong
QueueNo delete within the visibility timeout; message became visible again at 10:05.The consumer failed. Redeliver.✕ wrong
Worker 2The message at 10:05.An unprocessed job.✕ wrong
EngineerNo crashes, no errors, duplicates only on long videos.The queue is redelivering messages it should not.✕ wrong

4 of 4 parties reasoned correctly from what they could see and still reached the wrong conclusion. Nobody in this table is careless. Each one acted on complete-looking local information, and the information was local. That gap — between what a node can observe and what is true — is the whole domain, and one of these readings will usually be yours.

Commit before you read on

No worker crashed and every delete succeeded. Commit before reading on: state what a visibility timeout is actually a bet about, and explain why the duplicates correlate with video length.

Write it down even if you are unsure. An unwritten guess quietly becomes “that is what I thought” the moment you read the answer.

Everything below stays hidden until you commit. Being wrong here is the exercise — the answer looks obvious the moment you read it, which is exactly why reading it first teaches nothing.