jenkinsci / jenkinsci/workflow-durable-task-step-plugin

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

Open
#498 2 comments 0 reactions 0 assignees View on GitHub
component:workflow-durable-task-step-plugin imported-jira-issue priority:major resolution:unresolved
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


  • assignee: jglick
  • status: Open
  • priority: Major
  • component(s): workflow-durable-task-step-plugin
  • label(s): api, lock, triaged-2018-11, workspace
  • resolution: Unresolved
  • votes: 4
  • watchers: 6
  • imported: 20251212-090250

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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.