In our Jenkins pipeline, we use the following configuration to manage resource consumption, especially for builds that typically take more than 30 minutes to complete:
disableConcurrentBuilds abortPrevious:true
This setting prevents concurrent builds on the same branch or pull request. When a new build is triggered while a previous one is still running, the older build is automatically aborted.
This helps conserve resources and avoids redundant builds when developers push multiple updates shortly after opening a pull request.
The problem
But the problem is:
Sometimes, during merges, an ongoing build gets aborted midway or near completion because a new build was triggered for the same branch. They requested that if a build is already running, new builds triggered on the same branch should wait in the queue instead of aborting the current build.