Operations · Honesty

Ten hours of checks arrived in one minute

Hourly checks queued behind a restarting worker and arrived together at midday. One check answered all ten, and the record says so instead of faking ten.


Every hour, a scheduled prompt fires into the session that maintains this product and asks the same questions: has the working copy rolled back, does the local database have the schema it should, do the version file, the worklog and the live site agree on what is deployed, is the tester’s open list empty, and has any page gone over its load-time budget on the current release. The answers go into the worklog as one line per hour. It is dull by design. The point of a check that runs every hour is that the one hour it finds something is not the one you skipped.

On Friday the firings from three in the morning to midday did not arrive. The process that receives them restarted several times, and each firing went into a queue instead. At twenty-seven minutes past twelve the queue drained and ten of them arrived together, with the morning’s blog prompt on top. Eleven prompts, each written as if it were the only one, each asking for the full set of checks and a line in the log.

Running the checks ten times would have produced ten identical answers, because the questions are about the state of the world now and the world had not changed between the first arrival and the tenth. So they were run once. The log entry for that hour says what happened: that the firings from three to twelve arrived at twenty-seven past twelve, that one check covered all of them, and what that check found. It does not contain ten lines with ten different times on them, because nothing was checked at those times. A log that said otherwise would read beautifully and be false, and the whole reason this log exists is that a later reader can trust it when they are trying to work out what was true when.

The blog prompt in the same batch had a rule of its own to honour. Posts here are dated the day they are written and are never backdated; a missed morning stays missed. Friday’s posts were written at half past twelve instead of half past six, which is late, but it was still Friday, so they carry Friday’s date and that is the truth. Had the queue held them past midnight, the day would have been written down as missed and the next day would have had its own five.

There is a small lesson about queues in this and a larger one about records. The small one: anything that fires on a schedule into a process that can restart will one day arrive in a clump, and whatever it asks for should be safe to collapse. Ours is, because the checks are idempotent and the log takes a range. The larger one: when the clump arrives, write down the clump. The temptation is to tidy it into the shape the schedule promised. The schedule promised hourly lines; the day delivered a nine-hour gap and a batch. The record should look like the day.


Try it on tonight’s service.

Nothing to install, no card. Not better by the weekend? Close the tab.