My batch job kept its progress in a Python dict, and I genuinely believed that was fine for a two-hundred-item run that should take eleven minutes. Then the output file came back with more lines than the input file, and three of them were near-identical summaries of the same ticket. Nothing in the log said "restart" — no traceback, no exit code, no farewell note from the process. So the real question was not "why did the model return the same thing twice?" but "how many times did my process actually start?"
The next 48 hours were mostly me learning to answer that second question before touching anything else. This is what I tried, what broke, what I would repeat, and the small amount of code that survived the weekend.
The bug looked like a duplicate-row bug, and it wasn't
My first instinct was the usual one: assume the endpoint answered twice and the writer appended twice. I added a seen set, deduplicated at the end, and declared victory around hour two. The victory last
Discussion
Say something first
It all starts with you—share your thoughts now.