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 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 preview runs the real matcher. The scheduler got a small dry-run call that takes a config and a list of workloads. It runs the same matching code admission uses without changing a thing. There’s no second copy of the rules in the console or the backend. If the preview could disagree with the real thing, it would be worse than nothing.
- History, not guesses. Months of runs collapse into one row per distinct workload, sorted by how often it ran. That keeps the list short. The busiest workloads come first.
- The same answer every time. The history stays pinned while you edit. The same draft always gives the same result. Refreshing is a button, not a side effect of typing.
- A rejected row is a fix. You can open a rejected workload, see its labels and add a rule for it right there.
- Saving tells you the number. When you apply, the dialog doesn’t just ask if you’re sure. It tells you how many of your recent workloads this config would have rejected.
- It never blocks. If the preview is unavailable, applying still works. The structural warning still shows. When it can’t see something, it says so instead of showing zero. That includes workloads on machine pools not in this history.
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:
- When a tool is dangerous because it’s powerful, don’t weaken it. Weakening it is easy to build and hard to undo. The people who needed the power will route around you.
- Make the consequence visible before the action. Friction asks people to be careful. A preview shows them what careful means.
- Use real data and the real logic. A preview built on a reimplementation is a second product that drifts.
- Warn, don’t block. The person applying the config knows things you don’t.

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.