-
Bug
-
Resolution: Fixed
-
Major
-
-
2.2
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
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.
- duplicates
-
JENKINS-31801 Pipeline Support in Throttle Concurrent Builds
-
- Resolved
-
- relates to
-
JENKINS-37929 WorkUnitContext.actions does not populate for Pipeline steps
-
- Resolved
-
- links to
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:
, where "Working" is the name of the job. For Pipeline jobs, it looks like
, 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:
Pipeline jobs where the plugin does not work: