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

Limit concurrent builds for 1 MultiBranch project

    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
            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.
            Hide
            pkruk Piotr Krukowiecki added a comment -

            I would like to request this too. I can only run 1 build at time (does not matter what branch).

            Using lockable resources would be a workaround - as I understand I need to configure jenkins manually (add lockable resource), the Jenkinsfile is not enough...

            Show
            pkruk Piotr Krukowiecki added a comment - I would like to request this too. I can only run 1 build at time (does not matter what branch). Using lockable resources would be a workaround - as I understand I need to configure jenkins manually (add lockable resource), the Jenkinsfile is not enough...
            Hide
            amidar Amit Dar added a comment - - edited

            I'm encountering this issue as well as a major drawback in the multi branch pipeline.

            the node i'm running on assigns the same workspace to two consecutive builds, which interrupt each other (the second build starts before the first is finished, this happens if two consecutive commits are done one after another during a short period of time)

            I kindly ask to address this issue -> would make a significant improvement!

            Show
            amidar Amit Dar added a comment - - edited I'm encountering this issue as well as a major drawback in the multi branch pipeline. the node i'm running on assigns the same workspace to two consecutive builds, which interrupt each other (the second build starts before the first is finished, this happens if two consecutive commits are done one after another during a short period of time) I kindly ask to address this issue -> would make a significant improvement!

              People

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

                Dates

                • Created:
                  Updated: