Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-75250

Workspace cleanup thread creates new workspaces

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • p4-plugin
    • 1.17.1

      The workspace cleanup thread calls "processWorkspaceBeforeDeletion":

      https://github.com/jenkinsci/jenkins/blob/e34bdcfdc0665c064dd825cf0d33a949bfd23c44/core/src/main/java/hudson/model/WorkspaceCleanupThread.java#L125

       

      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.

       

       

       

          [JENKINS-75250] Workspace cleanup thread creates new workspaces

          There are no comments yet on this issue.

            Unassigned Unassigned
            p4karl Karl Wirth
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: