Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-35359

Limit concurrent builds for 1 MultiBranch project

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I am currently running the latest version of the Pipeline plugin and i have created a multi-branch job. Everything is running fine on my Jenkinsfile but i would like to limit only 1 concurrent build for my entire multi-branch project. I see that you can set the option individually for the sub-sequent (branch) job but i would like to know if there is a way to limit it for the entire folder.

        Attachments

          Issue Links

            Activity

            Hide
            petersbattaglia Peter Battaglia added a comment -

            Is there a timeline for a fix for this issue – or a reasonable workaround?

            Show
            petersbattaglia Peter Battaglia added a comment - Is there a timeline for a fix for this issue – or a reasonable workaround?
            Hide
            jglick Jesse Glick added a comment -

            Use lock (outside node!).

            Show
            jglick Jesse Glick added a comment - Use lock (outside node !).
            Hide
            qhartman Quentin Hartman added a comment -

            I agree that the lock, even outside the context of node isn't really a solution here.

             

            I have two builds, A and B. Build A requires that it is build one at a time on a node. Build B does not. If what I've seen is correct, a resource locked by build A will prevent build B from running on that resource as well. This is not what I want.

            Am I missing something? There's no reason to waste the time waiting for A to finish when I have B builds waiting to go.

            Show
            qhartman Quentin Hartman added a comment - I agree that the lock, even outside the context of node isn't really a solution here.   I have two builds, A and B. Build A requires that it is build one at a time on a node. Build B does not. If what I've seen is correct, a resource locked by build A will prevent build B from running on that resource as well. This is not what I want. Am I missing something? There's no reason to waste the time waiting for A to finish when I have B builds waiting to go.
            Hide
            pjhayward Phillip Hayward added a comment -

            Lockable resource do not solve this issue.  Let me clarify my use case:

            I have a shared Jenkins installation.  We have a number of teams using multi-branch pipeline jobs.  Sometimes a team will have a large number of branches build concurrently - for example, they have a lot of feature branches that all depend on a given snapshot, and are configured to build when an upstream project builds.  Another example is when a project is migrated from SVN to git.  Regardless of the actual trigger, the result is that every other project is effectively blocked out because we have no realistic way to limit the concurrent branches for a given project.  Implementing a lockable resource for every single project could technically solve the issue, but would be overly burdensome to administrate, and would then restrict us to a single concurrent branch, where we would prefer to allow up to four concurrent branches per project.

             

            Show
            pjhayward Phillip Hayward added a comment - Lockable resource do not solve this issue.  Let me clarify my use case: I have a shared Jenkins installation.  We have a number of teams using multi-branch pipeline jobs.  Sometimes a team will have a large number of branches build concurrently - for example, they have a lot of feature branches that all depend on a given snapshot, and are configured to build when an upstream project builds.  Another example is when a project is migrated from SVN to git.  Regardless of the actual trigger, the result is that every other project is effectively blocked out because we have no realistic way to limit the concurrent branches for a given project.  Implementing a lockable resource for every single project could technically solve the issue, but would be overly burdensome to administrate, and would then restrict us to a single concurrent branch, where we would prefer to allow up to four concurrent branches per project.  
            Hide
            jglick Jesse Glick added a comment -

            By the way there is a Throttle builds branch property (Pipeline: rateLimitBuilds job property) which is appropriate for certain scenarios. Currently it only throttles builds within a branch project, though, not across branches. The feature is built into the multibranch system (i.e., branch-api, not this plugin) for historical reasons.

            Show
            jglick Jesse Glick added a comment - By the way there is a Throttle builds branch property (Pipeline: rateLimitBuilds job property) which is appropriate for certain scenarios. Currently it only throttles builds within a branch project, though, not across branches. The feature is built into the multibranch system (i.e., branch-api , not this plugin) for historical reasons.

              People

              • Assignee:
                Unassigned
                Reporter:
                zikphil Philippe Labat
              • Votes:
                21 Vote for this issue
                Watchers:
                25 Start watching this issue

                Dates

                • Created:
                  Updated: