News for hackers. Stuff that matters.
Re:Replacing cron jobs with a centralized task scheduler by maxbond on Friday August 01, 2025 @11:28AM (#44758284)
They're proposing doing it in one transaction as a heartbeat.

> - If you find an unlocked task in 'executing', you know the processor died for sure. No heuristic needed

Re:Replacing cron jobs with a centralized task scheduler by diarrhea on Saturday August 02, 2025 @03:34AM (#44765532)
Yes, and that cannot work: if a task is unlocked but in 'executing' state, how was it unlocked but its state not updated?

If a worker/processor dies abruptly, it will neither unlock nor set the state appropriately. It won't have the opportunity. Conceptually, this failure mode can always occur (think, power loss).

If such a disruption happened, yet you later find tasks unlocked, they must have been unlocked by another system. Perhaps Postgres itself, with a killer daemon to kill long-running transactions/locks. At which point we are back to square one: the job scheduling should be robust against this in the first place.