4 min read

Keep the knife sharp: how a preview made our scheduler safe without making it weaker

The workload scheduler I work on decides which workloads run where across a whole organization. It also decides which ones don’t run at all. An admin writes a config with queues and rules. The scheduler checks those rules top to bottom, so the first match wins. A workload that matches no rule fails right away.

That last part is on purpose. It’s also how one organization blocked every workload it had with a single config change. Their rules had a gap, so everything that fell through failed.

The scheduler is a sharp knife. The question was what to do about it.

The obvious fix makes the knife duller

My first instinct was a safer default. Let unmatched workloads through instead of failing them, so nobody gets locked out.

A knife with its blade wrapped in a fat grey foam sleeve, lying on a cutting board, labelled duller

A colleague on the scheduler team pushed back. They were right. Picture a user asking for an expensive instance type that no rule covers. A quiet pass-through admits it. That’s exactly what the admin wrote the rules to stop. The rules are the product. A scheduler that ignores them when they don’t match isn’t safer - it’s less useful. It fails silently instead of loudly.

A forgiving default doesn’t remove the risk - it moves it where nobody looks.

We had already tried the other common move: friction. Applying a config opened a confirmation dialog with a warning when the config had no catch-all rule. Later, you had to type “change config” to apply it. Both helped a little. A dialog only asks “are you sure?” The person clicking has no new information to be sure with. They were sure before they clicked.

Show the cut before you make it

The admin needs one concrete answer: if I apply this, which of my workloads fail?

We can answer that because the scheduler already records every workload it sees. Next to the config editor, a preview runs before you save anything. It replays the last 90 days of your organization’s real workloads against the config you’re editing. It shows which ones would be admitted, to which queue and which would be rejected.

A few decisions made it trustworthy:

The scheduler’s behavior didn’t change at all. Unmatched workloads still fail loudly. You just find out on your screen instead of in production.

What I took from it

It shipped as nine small pull requests. A few weeks later, it went on for every organization. Since then, I keep running into the same choice in other places. I make it the same way:

A person walks around the top of a short solid wall on a dashed path to reach a solid box, with the wall labelled weakened and the path labelled around you

I made the same call in our permission system. The obvious fix there was to quietly give people access they didn’t ask for. That’s its own post.