-
Bug
-
Resolution: Duplicate
-
Critical
When a pipeline has an outer lock of a resource and then runs multiple tasks in parallel which have inner locks. The outer lock is sometimes prematurely cleared when the parallel tasks clear their inner lock.
This bug was introduced in 1.11 and does not appear in 1.10
A sample pipeline job is below. When the 1st parallel jobs completes, it releases the inner lock as expected. When the 2nd parallel job completes, it releases the inner lock but the outer lock is also cleared. This could be due to clean up code that is clearing a resource lock that it shouldn't be.
node('master'){ // outer lock here, this should persist until the end lock('outer') { sh "sleep 10" def stepsForParallel = [:] for (int i = 1; i <= 4; i++) { def stepName = "Inner Run - ${i}" stepsForParallel[stepName] = test() } parallel stepsForParallel sh "sleep 10" } } def test() { return { // create an inner lock which the parallel tasks will queue around lock('inner') { sh "sleep 10" } } }
- duplicates
-
JENKINS-40879 Locked areas are executed multiple times in parallel
- Closed