Reuse workspace lease across several node blocks

18 views
Skip to first unread message

Konrad Windszus

unread,
May 13, 2021, 8:15:33 AM5/13/21
to Jenkins Users
Hi,
in a scripted pipeline I have several node blocks. This is because I need to wait for input or external systems and don't want to block executor slots during that time.
Afterwards I want to continue to work on the workspace, therefore I create a new node block using the same label (to ensure I end up on the same computer).

The problem is that sometimes Jenkins has already cleared the workspace because the WS lease has been released when leaving the previous node block (https://github.com/jenkinsci/workflow-durable-task-step-plugin/blob/2a88fdd885caa0d1bcf3336efc00b579b75ced82/src/main/java/org/jenkinsci/plugins/workflow/support/steps/ExecutorStepExecution.java#L768).

I found the API WorkspaceList.Lease.createLinkedDummyLease(....) which would be good for my use case, unfortunately I haven't found a workflow plugin that leverages this.

How to accomplish reusing the same workspace across multiple nodes in a scripted pipeline?

Thanks,
Konrad
Reply all
Reply to author
Forward
0 new messages