-
Bug
-
Resolution: Fixed
-
Critical
-
None
-
workflow-cps-global-lib:2.5
Jenkins:2.19.4
It seems like PR:18 introduced a race-condition when you have several builds of the same job starting at the same time.
Looking at the code in the pull request:
try (WorkspaceList.Lease lease = computer.getWorkspaceList().allocate(dir)) { delegate.checkout(run, dir, listener, node.createLauncher(listener)); // Cannot add WorkspaceActionImpl to private CpsFlowExecution.flowStartNodeActions; do we care? // Copy sources with relevant files from the checkout: dir.copyRecursiveTo("src/**/*.groovy,vars/*.groovy,vars/*.txt,resources/", null, target); }
We changed from using acquire to using allocate, which is non-blocking and instead append a suffix to the path if needed. The only problem with the change is that we still use the base directory given to allocate and ignoring the fact that we might have allocated another directory. Instead we should use lease.path, which is what we actually leased!
So the code should probably be in the lines of:
try (WorkspaceList.Lease lease = computer.getWorkspaceList().allocate(dir)) { delegate.checkout(run, lease.path, listener, node.createLauncher(listener)); // Cannot add WorkspaceActionImpl to private CpsFlowExecution.flowStartNodeActions; do we care? // Copy sources with relevant files from the checkout: lease.path.copyRecursiveTo("src/**/*.groovy,vars/*.groovy,vars/*.txt,resources/", null, target); }
- is duplicated by
-
JENKINS-41924 Pipeline Global Library parallel branches fails due to lock of lib
- Resolved
- relates to
-
JENKINS-38517 “Local module directory” not supported for external libraries
- Open
- links to