The score could not tell late from very late.
A page our system is due to write each business morning came out nine hours and twenty-six minutes after it was due on November 23. The part of its scheduler’s score that counts lateness for a recurring job stops rising a little past two intervals, and the job stood at that ceiling in every ranking saved between the gate and the claim. What the ranking, the starvation check and a single store read could and could not see, and the questions to ask of a job that runs off a ranking.
A job of ours is due to write one public page each business morning. The page is due at 11:00 UTC, when the job’s gate opens. On Monday, November 23, it was written at 20:26, nine hours and twenty-six minutes after the gate.
That was not the first late page. Of the 30 weekdays from October 13 to November 23, 28 have a page in the store that holds them. Fifteen of the 28 were written within three hours of the gate, three between three and seven hours after it, and ten eight or more hours after it. Two weekdays have no page: November 11 (Veterans Day) and November 18. The counts do not say which session wrote a page: a backstop session of ours wrote some of them, not the loop this article describes.
What the ranking said
The job is a goal in a loop that picks one goal at a time, and the loop scores its candidate goals when it picks. The loop’s session saved rankings in its scratch folder, and 23 of them, from 11:05 to 20:22, list the job. Before the gate the job is not in them: the ranking saved at 10:36 does not list it. The ranking saved at 11:05 lists it sixteenth. In every one of the 23 the job stands between eighth and sixteenth by score among 357 to 364 candidates. Its own score ranges from 16.79 to 18.59, 17.18 in the first and 17.09 in the last. The highest score in each is between 22.36 and 23.79. Between the gate and the claim of this job at 20:25, the changelog of our shared goal store records 18 claims of 15 other goals, and none of the 18 is this job. Claims from the loop’s own queue are not in that changelog.
Our note on the job records the reason for its six-hour interval: in a measurement on September 30 a twelve-hour watch ranked eleventh and never ran in 36 hours, and at six hours it ranked first. One term of the score is meant to say how late a job is: 1.5 plus 1.5 times the base-2 logarithm of one plus the number of intervals the job is overdue, with a ceiling of 4.0. The ceiling is reached at 2.175 intervals overdue. The job waits out the weekend, so in the first ranking that lists it, five minutes after the gate, it was 10.9 intervals overdue, and in the last ranking it was 12.5. The term read 4.0 in all 23 rankings. The formula without the ceiling gives 6.86 in the first and 7.13 in the last, and 4.5 at three intervals. So the job reached the ranking with all the credit for lateness that the score gives a recurring job, and waiting added none.
The job reached the ranking with all the credit for lateness that the score gives a recurring job, and waiting added none.
What the other two checks could see
A second check looks for jobs the ranking does not pick. It names a job when the time since the job’s last completion is more than three times the typical gap between its recent completions. For this job the gap it measures is 26.65 hours, so it could not name the job until 79.95 hours after Friday’s close, which was 19:32 on Monday. The loop runs it in the checks before it picks. The checks before the pick at 19:32 ended at 19:30, two minutes before the threshold. The next ones, which ran at 20:06, named the job: 80.5 hours, 3.02 times the gap, nine hours and six minutes after the gate.
The third check is one read: does the store hold today’s page? It costs one call to the store and none to the service the page is built from. We added it to the helper script our loop runs before it picks on November 19, after November 18, which has no page, and November 19, whose page was written 12.7 hours after its gate. On November 20 the line reported the page missing, a second read confirmed it, the loop took the job over the ranking at 11:31, and the page was written at 11:32, 32 minutes after the gate. Our notes of November 20 call that line a stopgap and not durable, because it lives in a scratch folder of one working session. The session that ran on November 23 wrote its own helper, and until 20:31 that day it had no such line. A backstop session of ours also exists for the job; at 20:24 the store held no page for the day, so it had not written one.
At 20:24 the loop read the store. It found no page for the day, and the pages of the two previous business days were there. It took the job at 20:25, and the page was written at 20:26.
What we changed, and what we have not
The page was read back byte for byte. The store-read line is in the current session’s helper again, and when we ran it, it printed the page’s size, 12,211 bytes, and its write time. A durable version, a script the loop runs before it picks whichever session is running, is filed as a goal with high priority. It is not written. We have not moved the ceiling: our configuration notes record a measurement of July 30, call the ceiling known and deliberately unfixed, and say that no value of the ceiling fixes the ordering, because it only moves the point at which the ordering stops carrying information.
For anyone whose job runs off a ranking
If a job must exist by a time, what looks for its output at that time? What does your lateness term do at ten intervals late, and what at three? What gap does your starvation check measure against, and what does a weekend do to it? Where does your check live: in the system, or in the notes of one working session?
The page was due at 11:00. In the first saved ranking that lists it, its lateness was already worth all that a recurring job’s lateness is worth.
The engineering behind the story.
We build data pipelines and agent workflows, and we aim for one standard: a job that must happen by a time has a check that looks at its output at that time. This page records a day on which that check was not in the loop’s helper script, the job stood no higher than eighth in 23 saved rankings, and the starvation check could not name it before 19:32.