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

Throttling not working when based on parameters

    • 2.15

      The plugin option of "Prevent multiple jobs with identical parameters from running concurrently" is NOT preventing a second build from running, despite it sharing a parameter value with the already running first build.
      It says in JENKINS-37809 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. 

      Anyone aware of this and can suggest a solution or workaround?

          [JENKINS-67978] Throttling not working when based on parameters

          Nikita added a comment -

          What I've found up to this moment, this probably prevents the feature from working:

          In src/main/java/hudson/plugins/throttleconcurrents/ThrottleQueueTaskDispatcher.java,

          In isAnotherBuildWithSameParametersRunningOnNode() method,

          currentExecutable = exec.getCurrentExecutable() is always null.

          Consecutively, this disables parameter values checks at all.

          I was able to add some debugging: although really it loops on executors (and their amount corresponds number of active jobs running), each of executors reported as idle (exec.isIdle()==true), although it is certainly must be busy (I've created a job with a infinite loop, even without sleep()'s).

          I'm not a developer, and now I have no idea what to do next with this finding.

          I really need this feature in my project.

          Nikita added a comment - What I've found up to this moment, this probably prevents the feature from working: In src/main/java/hudson/plugins/throttleconcurrents/ThrottleQueueTaskDispatcher.java, In isAnotherBuildWithSameParametersRunningOnNode() method, currentExecutable = exec.getCurrentExecutable() is always null. Consecutively, this disables parameter values checks at all. I was able to add some debugging: although really it loops on executors (and their amount corresponds number of active jobs running), each of executors reported as idle (exec.isIdle()==true), although it is certainly must be busy (I've created a job with a infinite loop, even without sleep()'s). I'm not a developer, and now I have no idea what to do next with this finding. I really need this feature in my project.

          Nikita added a comment -

          It looks like I've found the cause (or, at least, workaround).

          Need to change

                      for (Executor exec : computer.getExecutors()) {

          to

                      for (Executor exec : computer.getAllExecutors()) {

          in otherBuildWithSameParametersRunningOnNode() method, and then it starts working as supposed to.

          Nikita added a comment - It looks like I've found the cause (or, at least, workaround). Need to change             for (Executor exec : computer.getExecutors()) { to             for (Executor exec : computer.get All Executors()) { in otherBuildWithSameParametersRunningOnNode() method, and then it starts working as supposed to.

          Nikita added a comment -

          Nikita added a comment - Created PR for this: https://github.com/jenkinsci/throttle-concurrent-builds-plugin/pull/232

          Basil Crow added a comment -

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

            nsmirnov Nikita
            smits Amit Shur
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: