[JIRA] (JENKINS-37809) Throttling based on parameters does not work in Pipelines

245 views
Skip to first unread message

alunsford@webassign.net (JIRA)

unread,
Aug 30, 2016, 9:06:01 AM8/30/16
to jenkinsc...@googlegroups.com
Aaron Lunsford created an issue
 
Jenkins / Bug JENKINS-37809
Throttling based on parameters does not work in Pipelines
Issue Type: Bug Bug
Assignee: Oleg Nenashev
Attachments: Screen Shot 2016-08-29 at 5.05.27 PM.png
Components: throttle-concurrent-builds-plugin
Created: 2016/Aug/30 1:05 PM
Priority: Major Major
Reporter: Aaron Lunsford

Configuration

  1. Pipeline job with parameters
  2. Execute concurrent builds if necessary: true
  3. Throttle Concurrent Builds: true
  4. Prevent multiple jobs with identical parameters from running concurrently: true

Notes - Job parameters are defined as part of the pipeline setup with the properties command

Problem When throttling based on one of the job's parameters, the plugin does not prevent multiple builds from running concurrently when the defined parameter is the same.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

alunsford@webassign.net (JIRA)

unread,
Aug 30, 2016, 9:07:01 AM8/30/16
to jenkinsc...@googlegroups.com
Aaron Lunsford updated an issue
Change By: Aaron Lunsford
h3. Configuration

# Pipeline job with parameters
# Execute concurrent builds if necessary: true
# Throttle Concurrent Builds: true
# Prevent multiple jobs with identical parameters from running concurrently: true

h3. Notes

- Job parameters are defined as part of the pipeline setup with the {{properties}} command

h3. Problem
When throttling based on one of the job's parameters, the plugin does not prevent multiple builds from running concurrently when the defined parameter is the same.

alunsford@webassign.net (JIRA)

unread,
Sep 1, 2016, 10:00:05 AM9/1/16
to jenkinsc...@googlegroups.com
Aaron Lunsford commented on Bug JENKINS-37809
 
Re: Throttling based on parameters does not work in Pipelines

I did some more digging on the issue and it looks like problem is in the getParametersFromWorkUnit() method. On Freestyle jobs, the conditional that checks unit.context.actions gets populated with values, but for Pipeline jobs it does not.

The WorkUnit object that is passed to getParametersFromWorkUnit() for a normal job looks like this: hudson.model.queue.WorkUnit@53acb86e[work=Working], where "Working" is the name of the job. For Pipeline jobs, it looks like hudson.model.queue.WorkUnit@496091d7work=part of Throttle-this #11, where "Throttle-this" is the name of the job and "#11" is the build number.

To try and summarize:

Freestyle jobs where the plugin works:

  • WorkUnit object: hudson.model.queue.WorkUnit@53acb86e[work=Working]
  • WorkUnit.context: hudson.model.queue.WorkUnitContext@14401e37
  • WorkUnit.context.actions: [hudson.model.ParametersAction@7e92e075, hudson.model.CauseAction@1d3d3d46]

Pipeline jobs where the plugin does not work:

  • WorkUnit object: hudson.model.queue.WorkUnit@496091d7work=part of Throttle-this #11
  • WorkUnit.context: hudson.model.queue.WorkUnitContext@47a7768b
  • WorkUnit.context.actions: []

alunsford@webassign.net (JIRA)

unread,
Sep 1, 2016, 10:02:07 AM9/1/16
to jenkinsc...@googlegroups.com
Aaron Lunsford edited a comment on Bug JENKINS-37809
I did some more digging on the issue and it looks like problem is in the {{getParametersFromWorkUnit()}} method. On Freestyle jobs, the conditional that checks {{unit.context.actions}} gets populated with values, but for Pipeline jobs it does not.

The {{WorkUnit}} object that is passed to {{getParametersFromWorkUnit()}} for a normal job looks like this: {{hudson.model.queue.WorkUnit@53acb86e[work=Working]}}, where "Working" is the name of the job. For Pipeline jobs, it looks like {{hudson.model.queue.WorkUnit@496091d7[work=part of Throttle-this #11]}}, where "Throttle-this" is the name of the job and "#11" is the build number.


To try and summarize:

Freestyle jobs where the plugin works:
{noformat}
- WorkUnit object: {{ hudson.model.queue.WorkUnit@53acb86e[work=Working] }}
- WorkUnit.context:
{{ hudson.model.queue.WorkUnitContext@14401e37 }}
- WorkUnit.context.actions:
{{ [hudson.model.ParametersAction@7e92e075, hudson.model.CauseAction@1d3d3d46]
{noformat
} }

Pipeline jobs where the plugin does not work:
{noformat}
- WorkUnit object: {{ hudson.model.queue.WorkUnit@496091d7[work=part of Throttle-this #11] }}
- WorkUnit.context:
{{ hudson.model.queue.WorkUnitContext@47a7768b }}
- WorkUnit.context.actions:
{{ []
{noformat
} }

alunsford@webassign.net (JIRA)

unread,
Sep 2, 2016, 9:33:01 AM9/2/16
to jenkinsc...@googlegroups.com
Aaron Lunsford updated an issue
Change By: Aaron Lunsford
h3. Configuration
# Pipeline job with parameters
# Execute concurrent builds if necessary: true
# Throttle Concurrent Builds: true
# Prevent multiple jobs with identical parameters from running concurrently: true

h3. Notes
- Job parameters are defined as part of the pipeline setup with the {{properties}} command
- This is also an issue when properties are not defined as part of the pipeline setup, and are configured through the UI directly

h3. Problem
When throttling based on one of the job's parameters, the plugin does not prevent multiple builds from running concurrently when the defined parameter is the same.

alunsford@webassign.net (JIRA)

unread,
Sep 2, 2016, 9:34:02 AM9/2/16
to jenkinsc...@googlegroups.com
Aaron Lunsford edited a comment on Bug JENKINS-37809
I did some more digging on the issue and it looks like problem is in the {{getParametersFromWorkUnit()}} method. On Freestyle jobs, the conditional that checks {{unit.context.actions}} gets populated with values, but for Pipeline jobs it does not.

The {{WorkUnit}} object that is passed to {{getParametersFromWorkUnit()}} for a normal job looks like this: { { noformat} hudson.model.queue.WorkUnit@53acb86e[work=Working] {noformat } } , where "Working" is the name of the job. For Pipeline jobs, it looks like { { noformat} hudson.model.queue.WorkUnit@496091d7[work=part of Throttle-this #11] {noformat } } , where "Throttle-this" is the name of the job and "#11" is the build number.


To try and summarize:

Freestyle jobs where the plugin works:
{noformat}
- WorkUnit object: hudson.model.queue.WorkUnit@53acb86e[work=Working]
- WorkUnit.context: hudson.model.queue.WorkUnitContext@14401e37
- WorkUnit.context.actions: [hudson.model.ParametersAction@7e92e075, hudson.model.CauseAction@1d3d3d46]
{noformat}

Pipeline jobs where the plugin does not work:
{noformat}
- WorkUnit object: hudson.model.queue.WorkUnit@496091d7[work=part of Throttle-this #11]
- WorkUnit.context: hudson.model.queue.WorkUnitContext@47a7768b
- WorkUnit.context.actions: []
{noformat}

jglick@cloudbees.com (JIRA)

unread,
Sep 9, 2016, 4:46:03 PM9/9/16
to jenkinsc...@googlegroups.com

o.v.nenashev@gmail.com (JIRA)

unread,
Feb 17, 2017, 4:15:01 PM2/17/17
to jenkinsc...@googlegroups.com

o.v.nenashev@gmail.com (JIRA)

unread,
Feb 17, 2017, 4:15:03 PM2/17/17
to jenkinsc...@googlegroups.com
Oleg Nenashev commented on New Feature JENKINS-37809
 
Re: Throttling based on parameters does not work in Pipelines

TCB plugin is not integrated with Pipeline, so it is a New Feature.

o.v.nenashev@gmail.com (JIRA)

unread,
Feb 17, 2017, 4:16:01 PM2/17/17
to jenkinsc...@googlegroups.com
Oleg Nenashev resolved as Duplicate
 

Closing as a duplicate of JENKINS-31801

Change By: Oleg Nenashev
Status: Open Resolved
Resolution: Duplicate

HemangLavana@java.net (JIRA)

unread,
Feb 17, 2017, 5:04:03 PM2/17/17
to jenkinsc...@googlegroups.com
HemangLavana commented on New Feature JENKINS-37809
 
Re: Throttling based on parameters does not work in Pipelines

Are you sure, it is duplicate: when I looked at JENKINS-31801, it seems to be about supporting throttle feature within the pipeline. Whereas if you look at the screenshot attached to this issue, it is about using TCB and pipeline like any other normal job.

And this specific issue is that the feature in TCB plugin "to throttle based on job parameters" for pipeline jobs does not work whereas it works for normal jobs.

o.v.nenashev@gmail.com (JIRA)

unread,
Feb 17, 2017, 5:12:09 PM2/17/17
to jenkinsc...@googlegroups.com

HemangLavana I am sure. TCB plugin is not integrated with Pipeline, which is explicitly mentioned in https://github.com/jenkinsci/pipeline-plugin/blob/master/COMPATIBILITY.md . It means that any TCB plugin logic may work incorrectly with Pipeline.

HemangLavana@java.net (JIRA)

unread,
Feb 17, 2017, 5:25:02 PM2/17/17
to jenkinsc...@googlegroups.com

clauto@gmail.com (JIRA)

unread,
Aug 29, 2019, 5:10:03 PM8/29/19
to jenkinsc...@googlegroups.com

Oleg Nenashev

Can this bug be reopened now?

Pipeline support of TCB was added in 2.0 and 2.01

However parameter based throttling was not added, or does this instead need to be a new feature request?

I am leaning towards bug because there exists no way to do parameter throttling unless using freestyle, but as referenced here

https://github.com/jenkinsci/pipeline-plugin/blob/master/COMPATIBILITY.md

TCB has indeed been added to pipeline support.

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

clauto@gmail.com (JIRA)

unread,
Sep 5, 2019, 2:06:05 PM9/5/19
to jenkinsc...@googlegroups.com
Leeam Dagan reopened an issue
 
Change By: Leeam Dagan
Resolution: Duplicate
Status: Resolved Reopened

vinus079@gmail.com (JIRA)

unread,
Sep 17, 2019, 9:45:03 PM9/17/19
to jenkinsc...@googlegroups.com
Vinay Somashekar updated an issue
 
Jenkins / Bug JENKINS-37809
Change By: Vinay Somashekar
Issue Type: New Feature Bug
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

vinus079@gmail.com (JIRA)

unread,
Sep 17, 2019, 9:47:03 PM9/17/19
to jenkinsc...@googlegroups.com
Vinay Somashekar commented on Bug JENKINS-37809
 
Re: Throttling based on parameters does not work in Pipelines

Oleg Nenashev, Could you please look at this one? Now, this should be a bug and not Feature. 

 

yeluolei@gmail.com (JIRA)

unread,
Feb 1, 2020, 7:47:05 AM2/1/20
to jenkinsc...@googlegroups.com
Rurui Ye commented on Bug JENKINS-37809

any update on this? I saw it was linked to the workUnitContext issue

dan666@gmail.com (JIRA)

unread,
Feb 10, 2020, 2:20:04 AM2/10/20
to jenkinsc...@googlegroups.com

+1, any update on this ? we've used this plugin in the past but once we moved to pipelines its not working anymore, can't limit by parameters. 

nightfader@gmail.com (JIRA)

unread,
Feb 14, 2020, 3:13:04 PM2/14/20
to jenkinsc...@googlegroups.com

We are having the same issue.
1. Uncheck "Do not allow concurrent builds"
2. Check "Throttle concurrent builds"
     -> Check "Prevent multiple jobs with identical parameters from running concurrently"

Below is Pipeline as code for the above steps:

// disableConcurrentBuilds(), --> Note concurrency is enabled since this line is commented out.
{{ [$class: 'ThrottleJobProperty', categories: [], limitOneJobWithMatchingParams: true, maxConcurrentPerNode: 0, maxConcurrentTotal: 0, paramsToUseForLimit: '', throttleEnabled: true, throttleOption: 'project'],}}

nightfader@gmail.com (JIRA)

unread,
Feb 14, 2020, 3:14:05 PM2/14/20
to jenkinsc...@googlegroups.com
Sherabi GuessWhat edited a comment on Bug JENKINS-37809
We are having the same issue.
1. Uncheck "Do not allow concurrent builds"
2. Check "Throttle concurrent builds"
     -> Check "Prevent multiple jobs with identical parameters from running concurrently"

Below is Pipeline as code for the above steps:

{{// disableConcurrentBuilds(), --> Note concurrency is enabled since this line is commented out.}}
{{ [$class: 'ThrottleJobProperty', categories: [], {color:# FF0000 ff0000 }limitOneJobWithMatchingParams: true{color}, maxConcurrentPerNode: 0, maxConcurrentTotal: 0, paramsToUseForLimit: '', {color:# FF0000 ff0000 }throttleEnabled: true{color}, throttleOption: 'project'] ,}}

nightfader@gmail.com (JIRA)

unread,
Feb 14, 2020, 3:14:06 PM2/14/20
to jenkinsc...@googlegroups.com
Sherabi GuessWhat edited a comment on Bug JENKINS-37809
We are having the same issue.
1. Uncheck "Do not allow concurrent builds"
2. Check "Throttle concurrent builds"
     -> Check "Prevent multiple jobs with identical parameters from running concurrently"

Below is Pipeline as code for the above steps:

{{
{{ // disableConcurrentBuilds(), --> Note concurrency is enabled since this line is commented out.}} }}
{{ [$class: 'ThrottleJobProperty', categories: [], {color:#ff0000}limitOneJobWithMatchingParams: true{color}, maxConcurrentPerNode: 0, maxConcurrentTotal: 0, paramsToUseForLimit: '', {color:#ff0000}throttleEnabled: true{color}, throttleOption: 'project'] }}

nightfader@gmail.com (JIRA)

unread,
Feb 14, 2020, 3:14:11 PM2/14/20
to jenkinsc...@googlegroups.com

fbladilo@redhat.com (JIRA)

unread,
Apr 7, 2020, 12:21:03 PM4/7/20
to jenkinsc...@googlegroups.com
Change By: Franco Bladilo
Status: Reopened Open
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

fbladilo@redhat.com (JIRA)

unread,
Apr 7, 2020, 12:24:03 PM4/7/20
to jenkinsc...@googlegroups.com
Franco Bladilo commented on Bug JENKINS-37809
 
Re: Throttling based on parameters does not work in Pipelines

Having the same issues not being able to throttle pipeline jobs based on parameters, has this received any attention/help/updates? This is causing a lot of pain on our internal CI. Running Jenkins jenkins-2.222.1 with latest TCB.

Reply all
Reply to author
Forward
0 new messages