1
votes

I'd like to prevent a job with the same parameters to run concurrently. I'm trying to use "Prevent multiple jobs with identical parameters from running concurrently" by setting "List of parameters to check".

When adding multiple comma-separated parameters to "List of parameters to check" it doesn't work as expected:

my job has 3 params: A, B, C

List of parameters to check: "A,B"

started a job with params: A:1, B:2, C:3

and tried to start another job in parallel: A:2, B:2, C:3

According to my understanding because "A,B" needs to be unique, the 2nd job should've started in parallel, because the 1st job's "A,B" is "1,2" and the 2nd job's is "2,2".

However it didn't start.

On the other hand I don't want C to be taken into account (C is the BUILD_ID of the job that triggered this job, so it's always different) so I don't want to leave "List of parameters to check" empty

1
It looks like this question is about the plugin Throttle Concurrent Builds. - zett42
That's right @zett42 - Gavriel
Sorry, I don't have experience with that one. - zett42
Consider marking the answer provided if it worked for you. It worked for me. - Klik

1 Answers

1
votes

Try changing the parameter list to a WhiteSpace separated list:
List of parameters to check: "A B"

Refer to https://issues.jenkins.io/browse/JENKINS-46858

"We tried setting a comma separated list of parameters, but that doesn't appear to work correctly. According to the code it appears to be using StringUtils.split, which is whitespace separated not comma separated. So I believe the documentation is just incorrect, but wanted to make sure. "

I am using the Jenkins Throttle Concurrent Builds Plug-in 2.0.1
I experienced the same problem. I changed the parameter list from comma to a WhiteSpace separated and it worked for me

According to the release notes this was fixed in 2.1 https://github.com/jenkinsci/throttle-concurrent-builds-plugin/releases