The Jenkins pipeline nobody dared restart
A three-hour release broke 45 minutes in, and the instruction was to finish it by hand. What that says about a pipeline, and four rules that fix it.
Written
The situation
A production release ran through one large Jenkins pipeline. Some stages ran in series, some in parallel. A full run took about three hours: build, tests, artifacts, deployment across several environments. It worked when everything went right.
One day a step failed about 45 minutes in. The instruction came at once: do not restart the pipeline. A restart might re-run a destructive step, duplicate an operation, or crash production.
That sentence should set off alarms. It says the pipeline depends on a perfect run.
What was wrong
The pipeline could not be restarted. It did not track where it had failed, and it had no checkpoints. Starting again meant starting from the top.
Its steps could not be repeated safely. Each one assumed it would run once, in order, without failure. Running a step twice might duplicate an operation, corrupt state or crash production.
State lived outside the pipeline: files created, services deployed, databases updated. Nothing recorded which of those had happened. After a failure, you inspected the world to find out where you were.
The version number lived in two places, the Maven pom.xml file and several Jenkins parameters. They had to match, and someone edited them by hand. Small sharp edges that cut you when you’re already bleeding.
So the release was finished by hand. Align the version in the pom.xml with the Jenkins parameters. Build the artifacts. Publish them. Deploy to each environment. Verify each one. You check logs, query systems and look at files, and you build a picture of where things are. That picture lives in your head, under pressure, with no safety net. Human memory had become the control plane.
What changed
Restartability became a design requirement. A pipeline that cannot be restarted safely is a scripted ceremony, and a ceremony is not production-ready.
Four rules followed.
- One source of truth for the version. Everything else derives from it, so nothing drifts and nobody synchronises by hand.
- Explicit checkpoints. The pipeline records what is done, and a restart skips it.
- Idempotent steps. Every step checks state before it acts and verifies the outcome after. Running it twice gives the same result as once.
- Build, publish and deploy as separate phases, each restartable on its own.
The dangerous part of that release was the bet on a perfect run. Every step has to execute and every external system has to stay up. Every human has to get it right, every time. Nobody wants that bet in production. The most dangerous sentence in a release is still “don’t restart the pipeline”. It tells you everything about the process.