jenkinsci / jenkinsci/workflow-durable-task-step-plugin
[JENKINS-36358] ws step does not lock the workspace
- Dominant language
- Java
- Stars
- 46
- Forks
- 110
- PR merge metrics
- No merged PRs in 30d
Description
Currently WorkspaceStepExecution just calls WorkspaceList.allocate. If there is some other build/thread using the designated workspace, it will simply append @2 etc.
Better would be to have an option to call acquire, which would pause until the workspace is released and then acquire an exclusive lock. Unfortunately this would block the CPS VM thread and not survive restarts. Could force the exact path to be acquired only by setting up a background thread (with onResume) to block, or adding a core API to register a callback listener when any existing lease is released.
---
Originally reported by
jglick, imported from: ws step does not lock the workspace
jglick
Raw content of original issue
Currently WorkspaceStepExecution just calls WorkspaceList.allocate. If there is some other build/thread using the designated workspace, it will simply append @2 etc.
Better would be to have an option to call acquire, which would pause until the workspace is released and then acquire an exclusive lock. Unfortunately this would block the CPS VM thread and not survive restarts. Could force the exact path to be acquired only by setting up a background thread (with onResume) to block, or adding a core API to register a callback listener when any existing lease is released.
Contributor guide
Assessment
This issue has not been assessed yet.