Interview Prep/CI/CD/Jenkins Pipelines and Agents

An approval step blocks the pipeline and the executor stays occupied for hours. Fix it.

IntermediateScenarioJenkins Pipelines and Agents
Answer

Situation read → The input is inside a stage that already holds an agent.

What I'd do →

  1. Set top-level agent none, and give each build stage its own agent.
  2. Put the input stage with agent none between them.
  3. Wrap it in timeout so abandoned runs expire.

Why → Waiting on a human consumes no executor, only a lightweight flyweight on the controller.

Interview tip → Same principle as not holding a DB connection while waiting on a user.

All CI/CD questions

More on Jenkins Pipelines and Agents