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.

          [JENKINS-36358] ws step does not lock the workspace

          Jesse Glick created issue -

          Jesse Glick added a comment -

          If implemented, could offer a Pipeline alternative to the Batch Task plugin.

          Jesse Glick added a comment - If implemented, could offer a Pipeline alternative to the Batch Task plugin.
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 173061 ] New: JNJira + In-Review [ 184910 ]
          Andrew Bayer made changes -
          Component/s New: pipeline-general [ 21692 ]
          Andrew Bayer made changes -
          Component/s Original: workflow-plugin [ 18820 ]
          Jesse Glick made changes -
          Component/s New: workflow-durable-task-step-plugin [ 21715 ]
          Component/s Original: pipeline [ 21692 ]
          Jesse Glick made changes -
          Link New: This issue is duplicated by JENKINS-41153 [ JENKINS-41153 ]
          Vivek Pandey made changes -
          Labels Original: api lock workspace New: api lock triaged-2018-11 workspace

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: