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

Concurrent Builds Plugin Does not work properly

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Duplicate
    • None
    • Jenkins ver. 2.73.2 ,throttle-concurrents-build plugin version = 2.0.0 and 2.0.1

    Description

      throttle-concurrents-build does not work as expected.Builds with different parameters are prevented from build.

      Steps to reproduce:

      1.Choose "Prevent multiple jobs with identical parameters from running concurrently"
      2.Set multiple parameters in "List of parameters to check".
      3.Run some builds with parameters.

      Screenshots with examples attached.

      Attachments

        Issue Links

          Activity

            oleg_nenashev Oleg Nenashev added a comment -

            Unfortunately I was unable to find time to work on plugin over last year. I decided to step down as maintainer and to mark the plugin for adoption.

            If anybody is interested, let me know

            oleg_nenashev Oleg Nenashev added a comment - Unfortunately I was unable to find time to work on plugin over last year. I decided to step down as maintainer and to mark the plugin for adoption. If anybody is interested, let me know
            famod Falko Modler added a comment - - edited

            A whitespace instead of comma to separate the parameter names seems to work for me. See also: https://github.com/jenkinsci/throttle-concurrent-builds-plugin/pull/59

            famod Falko Modler added a comment - - edited A whitespace instead of comma to separate the parameter names seems to work for me. See also: https://github.com/jenkinsci/throttle-concurrent-builds-plugin/pull/59
            coloradorob Rob Riggs added a comment -

            I'd like to add to this bug report because neither commas or whitespace separating the parameter list matters in my case.  I suspect it is because I am using the generic trigger plugin with a declarative pipeline.

            I am running version 2.0.2 of the plugin.

             

            // Prevent multiple concurrent builds of same repo & branch.
            properties([[
                $class: 'ThrottleJobProperty',
                categories: ['ci-category'],
                limitOneJobWithMatchingParams: true,
                maxConcurrentPerNode: 0,
                maxConcurrentTotal: 0,
                paramsToUseForLimit: 'projectName repoName branchName',
                throttleEnabled: true
            ]])
            
            pipeline {
                ...
                triggers {
                    GenericTrigger(
                        genericVariables: [
                            [key: 'projectName', value: '$.repository.project.name'],
                            [key: 'repoName', value: '$.repository.name'],
                            [key: 'branchName', value: '$.changes[0].ref.displayId'],
                            [key: 'latestCommit', value: '$.changes[0].toHash'],
                            [key: 'actorName', value: '$.actor.name']
                        ],
                        token: 'foo',
                        printContributedVariables: true,
                        printPostContent: true,
                        silentResponse: false,
                        causeString: 'Push to $branchName on $repoName by $actorName',
                        regexpFilterText: '$branchName',
                        regexpFilterExpression: '(?!.*2[.]01-).*'
                    )
                }
                
                parameters {
                    string(name: 'projectName', defaultValue: 'BAR', description: 'The Bitbucket project name [BAR]')
                    string(name: 'repoName', description: 'The Bitbucket repo name')
                    string(name: 'branchName', description: 'The git branch name')
                    string(name: 'latestCommit', description: 'The git commit ID to use')
                }
            
            

            Even though the jobs should all have valid parameters (must have valid parameters!), I still see the following in the log:

             

            Aug 06, 2020 1:42:39 PM FINE hudson.plugins.throttleconcurrents.ThrottleQueueTaskDispatcher
            build (hudson.model.queue.WorkUnit@3e53de05[work=BAR » CI #1332 (compile)]) with identical parameters ([]) is already running.
            

            I see the same result whether the parameter list (paramsToUseForLimit) are comma-delimited or space delimited.

            It seems to me that the parameter list should never be empty.  And if it is, the throttling should not occur.

            I will also note that the documentation is severely lacking in describing how to us this plugin with declarative pipeline jobs.

             

            coloradorob Rob Riggs added a comment - I'd like to add to this bug report because neither commas or whitespace separating the parameter list matters in my case.  I suspect it is because I am using the generic trigger plugin with a declarative pipeline. I am running version 2.0.2 of the plugin.   // Prevent multiple concurrent builds of same repo & branch. properties([[ $class: 'ThrottleJobProperty' , categories: [ 'ci-category' ], limitOneJobWithMatchingParams: true , maxConcurrentPerNode: 0, maxConcurrentTotal: 0, paramsToUseForLimit: 'projectName repoName branchName' , throttleEnabled: true ]]) pipeline { ... triggers { GenericTrigger( genericVariables: [ [key: 'projectName' , value: '$.repository.project.name' ], [key: 'repoName' , value: '$.repository.name' ], [key: 'branchName' , value: '$.changes[0].ref.displayId' ], [key: 'latestCommit' , value: '$.changes[0].toHash' ], [key: 'actorName' , value: '$.actor.name' ] ], token: 'foo' , printContributedVariables: true , printPostContent: true , silentResponse: false , causeString: 'Push to $branchName on $repoName by $actorName' , regexpFilterText: '$branchName' , regexpFilterExpression: '(?!.*2[.]01-).*' ) } parameters { string(name: 'projectName' , defaultValue: 'BAR' , description: 'The Bitbucket project name [BAR]' ) string(name: 'repoName' , description: 'The Bitbucket repo name' ) string(name: 'branchName' , description: 'The git branch name' ) string(name: 'latestCommit' , description: 'The git commit ID to use' ) } Even though the jobs should all have valid parameters (must have valid parameters!), I still see the following in the log:   Aug 06, 2020 1:42:39 PM FINE hudson.plugins.throttleconcurrents.ThrottleQueueTaskDispatcher build (hudson.model.queue.WorkUnit@3e53de05[work=BAR » CI #1332 (compile)]) with identical parameters ([]) is already running. I see the same result whether the parameter list (paramsToUseForLimit) are comma-delimited or space delimited. It seems to me that the parameter list should never be empty.  And if it is, the throttling should not occur. I will also note that the documentation is severely lacking in describing how to us this plugin with declarative pipeline jobs.  
            basil Basil Crow added a comment -

            A whitespace instead of comma to separate the parameter names seems to work for me

            This is JENKINS-46858, which was just fixed and released in 2.1.

            I suspect it is because I am using the generic trigger plugin with a declarative pipeline.

            This is JENKINS-61485, which remains open.

            I will also note that the documentation is severely lacking in describing how to us this plugin with declarative pipeline jobs.

            The documentation was updated in jenkinsci/throttle-concurrent-builds-plugin#100.

            basil Basil Crow added a comment - A whitespace instead of comma to separate the parameter names seems to work for me This is JENKINS-46858 , which was just fixed and released in 2.1 . I suspect it is because I am using the generic trigger plugin with a declarative pipeline. This is JENKINS-61485 , which remains open. I will also note that the documentation is severely lacking in describing how to us this plugin with declarative pipeline jobs. The documentation was updated in jenkinsci/throttle-concurrent-builds-plugin#100 .

            People

              Unassigned Unassigned
              gloomyday Alex Krotov
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: