The workspace cleanup thread calls "processWorkspaceBeforeDeletion":
This check causes new workspaces to be created for every job on every node:
2025/01/21 16:32:40 pid 3938459 jenkins@jenkins-myclient_MyTestJob 1.2.3.4 [jenkins.p4-plugin/1.17.0/Windows_11] 'user-info' 2025/01/21 16:32:40 pid 3938460 jenkins@jenkins-myclient_MyTestJob 1.2.3.4 [jenkins.p4-plugin/1.17.0/Windows_11] 'user-info' 2025/01/21 16:32:40 pid 3938461 jenkins@jenkins-myclient_MyTestJob 1.2.3.4 [jenkins.p4-plugin/1.17.0/Windows_11] 'user-client -o jenkins-myclient_MyTestJob' 2025/01/21 16:32:40 pid 3938462 jenkins@jenkins-myclient_MyTestJob 1.2.3.4 [jenkins.p4-plugin/1.17.0/Windows_11] 'user-client -i'
These workspaces are never used and never deleted.
Would be great if P4Jenkins tested in 'processWorkspaceBeforeDeletion' that a client exists before performing 'p4 client -o' and then 'p4 client -i'.
Reproduction Steps:
(1) Create 3 build agents.
(2) Create a single job that is pinned to only one of the agents.
(3) Wait for workspace cleanup to run (or find a way to trigger it).
(4) Check if a workspace has been created for every agent for this job.