Prevent the Multibranch Pipeline/Organization Folder from triggering builds on the initial indexing

1 minute readKnowledge base

Issue

During the initial indexing of a Multibranch Pipeline/Organization Folder, there may be numerous branches, pull requests, and tags that result in the creation of corresponding Pipelines. These Pipelines are scheduled to build simultaneously, creating a massive load on the Jenkins instance. The term used to describe this behavior is Build Storm.

Resolution

The recommended solution is to install the CloudBees Build Strategies plugin and enable the offered Build Strategy called Initial Index Build Prevention.

This strategy modifies the indexing behavior so that any branch, pull request, and tag discovered during the initial indexing creates a Pipeline but it does not build it. The Pipeline remains inactive until a new change has been pushed to the corresponding branch, pull request, or tag. Subsequent Multibranch or Organization scans will still not affect the Pipeline. When activity to the branch, pull request, or tag occurs, the Pipeline builds automatically.

Changes in configuration to the repository source behaviors or project recognizers result in resetting the indexing behavior back to an initial index.

To enable this strategy, perform the following steps:

  1. Create a Multibranch Pipeline or Organization Folder.

  2. Scroll down to Build Strategies.

  3. Select Add and then select Initial Index Build Prevention from the dropdown menu.