Our blog publisher was built to refuse rather than do something unsafe. Between 3 September and 5 November it refused on 54 mornings, correctly every time. The only place it said so was a log file.
Failing safe is good design. It doesn't mean the job can be left alone.
How it was built
The publisher ran at 08:30 each morning. It read the schedule, took the earliest post that was due and not yet published, and published it. If that post's file wasn't on disk, it stopped. It didn't skip ahead and it didn't guess. It wrote one line to its log and exited.
That's the behaviour you want. A publisher that guesses is how a half-built page goes live.
What happened
One entry in the schedule pointed at a post that was never written. On 3 September it became the earliest one due, and the publisher refused:
REFUSED: scheduled post [a post that was never written].html does not exist on disk -- it was scheduled but never built
It wrote the same line the next morning, and the one after that. The publisher only ever looks at the earliest due entry, so everything scheduled behind it waited.
How it stayed hidden
Nothing was down. The site answered. The job started on time every day and exited the way it was designed to. Any check that asks "did the job run?" got a yes.
In mid-September the problem was spotted once, from the other end: posts that were live on the site had no card on the blog index. The cards were added by hand, and the publisher was changed to skip a missing post and move on. A few posts went out. Adding the cards by hand also made the index look normal, which hid the fault a little further.
That skip didn't survive a later change to the publisher, and by 29 September the refusals were back. They continued every morning until 5 November.
A refusal that only reaches a log looks exactly like silence.
What we changed on 5 November
- Eight schedule entries had no post behind them. They moved out of the schedule into a separate held list.
- Fourteen posts that were already live but had never been marked published were marked.
- The next post due went out that morning.
- A new rule: an entry goes into the schedule only once the post exists on disk.
Making the refusal reach someone
That rule only removes this one cause. So on 6 November the publisher also changed what it does when it refuses. The first refusal for a given reason now puts a notice on the operator's board, where a person will see it. If it refuses again for the same reason, it stays quiet, so one stuck post produces one notice and not a fresh one every morning. We tested it: two refusals, one notice.
An empty calendar used to look like a quiet day, too. Now, on a morning with nothing due, the publisher looks a week ahead. If nothing is scheduled in that week, it raises one notice that day.
One gap is still open. The refusal notice arrives once, so if it gets dismissed and nobody acts, the queue can sit stuck with nothing more said. Nothing yet tracks how long a due post has been waiting. The check we recommend below, an alert when the last publish is older than the schedule says it should be, would close it. We haven't built that yet.
What to do
Pick one job you own that's built to fail safe: a backup, a sync, a batch run. Ask where its refusal goes. If the answer is a log, ask who reads that log, and when they last did.
Then alert on stuck, not only on unsafe. Raise something when the oldest item in the queue is older than it should be, or when the job's last success is older than its schedule. From where you sit, a job that refuses correctly every morning for two months has been down for two months.
Knowing a job is stuck, not just safe, is a discipline I've used through twenty years leading infrastructure. See the leadership record, or get in touch.