Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
Jenkins 2.39
lockable-resources-plugin 1.11
Description
My pipeline consists of several exclusive sections like this, which should never be executed in parallel:
milestone() lock(resource: "unit-tests", inversePrecedence: true) { milestone() stage('Unit Tests') { } } milestone() lock(resource: "integration-tests", inversePrecedence: true) { milestone() stage('Integration Tests') { } }
This worked perfectly fine with lockable-resources-plugin 1.10.
However with version 1.11 the locking does not work properly anymore.
It happens that two builds are running the integration tests in parallel,
although this should not be possible given the above configuration.
Whenever this happens I have a look at the http://<jenkins>/lockable-resources overview.
It shows that the resource is locked by only one build, although two builds are just concurrently executing the integration tests.
I am afraid it has to do with the recently implemented features:
JENKINS-34268- lock multiple resources concurrentlyJENKINS-34273- add the number of resources lo lock from a given label
Since I consider this a bug and regression, I changed the priority to critical.
Attachments
Issue Links
- is duplicated by
-
JENKINS-41868 Locks within parallel tasks release other locks within the pipeline
-
- Resolved
-
-
JENKINS-41183 Pipeline/Jenkinsfile: Nested lock() statements not working as expected
-
- Resolved
-
-
JENKINS-41858 Label + Quantity is sometimes not honored
-
- Closed
-
- links to
I am also experiencing this bug. I am running 3 instances of the same pipeline job in parallel (build1, build2, build3), all in contention for Resource 'A'. build1 acquires 'A', the next 2 wait. When the first job releases Resource A (via a Java exception in the groovy script), both build2 and build3 log that they have acquired the resource and execute the critical section in parallel. Chaos ensues.