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

Throttling based on parameters does not work with Pipeline jobs

    • 2.2

      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
      • This is also an issue when properties are not defined as part of the pipeline setup, and are configured through the UI directly

      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.

          [JENKINS-37809] Throttling based on parameters does not work with Pipeline jobs

          Leeam Dagan added a comment -

          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.

          Leeam Dagan added a comment - 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.

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

           

          Vinay Somashekar added a comment - oleg_nenashev , Could you please look at this one? Now, this should be a bug and not Feature.   

          Rurui Ye added a comment -

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

          Rurui Ye added a comment - any update on this? I saw it was linked to the workUnitContext issue

          Danny Gueta added a comment -

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

          Danny Gueta added a comment - +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. 

          Sherabi GuessWhat added a comment - - edited

          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']

          Sherabi GuessWhat added a comment - - edited 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']

          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.

          Franco Bladilo added a comment - 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.

          Basil Crow added a comment -

          Basil Crow added a comment - Fixed in jenkinsci/throttle-concurrent-builds-plugin#117 .

          Basil Crow added a comment -

          Released in 2.2.

          Basil Crow added a comment - Released in 2.2 .

          Amit Shur added a comment -

          I have a similar issue where Jenkins is NOT preventing a second build from running, despite it sharing a parameter value with the already running first build.
          It says here the issue was fixed in v2.2, however I've tried with all versions starting from v2.2 all the way to v2.6, and all failed. 
          Considering no one else has complained since the v2.2 release, does anyone have an idea as to what could be wrong in my setup that would cause the issue still to occur?
          Thanks you all.

          Amit Shur added a comment - I have a similar issue where Jenkins is NOT preventing a second build from running, despite it sharing a parameter value with the already running first build. It says here the issue was fixed in v2.2, however I've tried with all versions starting from v2.2 all the way to v2.6, and all failed.  Considering no one else has complained since the v2.2 release, does anyone have an idea as to what could be wrong in my setup that would cause the issue still to occur? Thanks you all.

          smits
          We have been using this simple patch instead of the fix for this issue for quite a while. Feel free to try it.

          Carsten Pfeiffer added a comment - smits We have been using this simple patch instead of the fix for this issue for quite a while. Feel free to try it.

            basil Basil Crow
            alunsford Aaron Lunsford
            Votes:
            13 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated:
              Resolved: