[JIRA] [workflow-plugin] (JENKINS-35359) Limit concurrent builds for 1 MultiBranch project

3 views
Skip to first unread message

philippe.labat@me.com (JIRA)

unread,
Jun 5, 2016, 1:19:01 PM6/5/16
to jenkinsc...@googlegroups.com
Philippe Labat created an issue
 
Jenkins / Bug JENKINS-35359
Limit concurrent builds for 1 MultiBranch project
Issue Type: Bug Bug
Assignee: Jesse Glick
Components: workflow-plugin
Created: 2016/Jun/05 5:18 PM
Priority: Minor Minor
Reporter: Philippe Labat

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.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

jglick@cloudbees.com (JIRA)

unread,
Jun 6, 2016, 4:24:01 PM6/6/16
to jenkinsc...@googlegroups.com
Jesse Glick resolved as Duplicate
Change By: Jesse Glick
Status: Open Resolved
Resolution: Duplicate

rsc@adr.de (JIRA)

unread,
Mar 15, 2017, 12:04:02 PM3/15/17
to jenkinsc...@googlegroups.com
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

rsc@adr.de (JIRA)

unread,
Mar 15, 2017, 12:06:01 PM3/15/17
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Mar 23, 2017, 6:03:02 PM3/23/17
to jenkinsc...@googlegroups.com

johannsig@gmail.com (JIRA)

unread,
Mar 21, 2018, 6:50:04 AM3/21/18
to jenkinsc...@googlegroups.com
Jóhann Sigurðsson edited a comment on Bug JENKINS-35359
Has this been resolved? I don't want two pipeline builds to each occupy an executor at the same time

johannsig@gmail.com (JIRA)

unread,
Mar 21, 2018, 6:50:04 AM3/21/18
to jenkinsc...@googlegroups.com

Has this been resolved? I don't want two pipeline builds to occupy an executor at the same time

johannsig@gmail.com (JIRA)

unread,
Mar 21, 2018, 9:03:02 AM3/21/18
to jenkinsc...@googlegroups.com

For anyone so inclined, I came up with a workaround by:

  1. Limiting Master node executors to 1
  2. Creating a local slave agent and hooking it up to master to care of other jobs
  3. Forcing pipeline builds to only run on the Master node

Declarative script example:

agent {
  label {
    label "Master"    
  }
}

 

 

johannsig@gmail.com (JIRA)

unread,
Mar 21, 2018, 9:04:03 AM3/21/18
to jenkinsc...@googlegroups.com
Jóhann Sigurðsson edited a comment on Bug JENKINS-35359
For anyone so inclined, I came up with a workaround by:
# Limiting Master node executors to 1
# Creating a local slave agent and hooking it up to
master Jenkins to take care of other jobs
# Forcing pipeline builds to only run on the Master node

Declarative script example:
{code:java}
agent {
  label {
    label "Master"    
  }
}
{code}
 

 

johannsig@gmail.com (JIRA)

unread,
Mar 21, 2018, 11:29:02 AM3/21/18
to jenkinsc...@googlegroups.com
Jóhann Sigurðsson edited a comment on Bug JENKINS-35359
For anyone so inclined, I came up with a workaround by:
# Limiting Master node executors to 1 Pipeline builds
# Creating a local slave agent and hooking it up to Jenkins to take care of other jobs
# Forcing pipeline builds to only run on the Master node

Declarative script example:
{code:java}
agent {
  label {
    label "Master"    
  }
}
{code}
 

 

petersbattaglia@gmail.com (JIRA)

unread,
Jun 22, 2018, 1:31:02 AM6/22/18
to jenkinsc...@googlegroups.com

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

jglick@cloudbees.com (JIRA)

unread,
Jun 26, 2018, 8:30:03 PM6/26/18
to jenkinsc...@googlegroups.com

Use lock (outside node!).

This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

qhartman@gmail.com (JIRA)

unread,
Oct 23, 2018, 5:15:03 PM10/23/18
to jenkinsc...@googlegroups.com

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.

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

phil.j.hayward@gmail.com (JIRA)

unread,
Apr 29, 2019, 11:24:02 AM4/29/19
to jenkinsc...@googlegroups.com

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.

 

jglick@cloudbees.com (JIRA)

unread,
Apr 29, 2019, 1:12:02 PM4/29/19
to jenkinsc...@googlegroups.com

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.

pkruk@parasoft.com (JIRA)

unread,
May 6, 2020, 12:14:05 PM5/6/20
to jenkinsc...@googlegroups.com

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...

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages