What happens to running pipeline builds when the controller restarts?
AdvancedConceptArchitecture, executors & JENKINS_HOME
Answer
Pipelines are designed to survive a restart. The CPS program state is persisted to build.xml/program.dat, and on startup Jenkins resumes each build. Running sh steps on agents keep going because durable tasks write output to files on the agent and Jenkins reattaches. This fails if the agent also died (Kubernetes pods are often gone), if the pipeline uses PERFORMANCE_OPTIMIZED durability, or if the build had disableResume(). Use Prepare for Shutdown (/safeExit or /quietDown) to let builds finish before maintenance.
More on Architecture, executors & JENKINS_HOME
What are the main components of a Jenkins installation?BeginnerWhat is the difference between a node, an agent and an executor?BeginnerWhy should the built-in node have 0 executors?BeginnerWhat is `JENKINS_HOME` and what are its most important contents?BeginnerWhat happens if you lose the `secrets/` directory but keep `credentials.xml`?AdvancedHow does an agent communicate with the controller?Intermediate