On a Tuesday in September a customer deployed a build that passed every check we had. Four minutes later a fifth of their visitors were seeing errors. This is what we missed and what we changed.
What the check asked
Our health check asked one question: does the app answer on / with a 200? The new build did. Its home page was static, and it rendered without touching anything else.
Every other page read from a database, and the build had shipped with the address of a database that no longer existed. The app was up. It just could not do its job.
A health check that only proves the process started is a check of the wrong thing.
The question we ask now
A project can name the path that proves it works, and that path should touch whatever the app cannot live without. Handoff calls it in every region before any traffic moves, and stops the deploy if one region says no.
[checks]
path = "/health"
timeout = "5s"
Catching what a check cannot
A check still only sees what it asks about. So the shift itself now watches the error rate. Traffic moves to a new deploy one region at a time, and if errors in that region pass the limit set in handoff.toml, the shift reverses on its own.
With both in place, the deploy from September would have stopped before a single visitor reached it. We replayed it to be sure.
Elin Sato