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

Renaming a job does not rename the workspace on slaves

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core

      When you rename a job that has slaves it does not rename (or delete) the workspace directory on them. This results in unused directories that can take up a lot of storage.

          [JENKINS-11200] Renaming a job does not rename the workspace on slaves

          evernat added a comment -

          Is it reproduced with a recent Jenkins version?

          evernat added a comment - Is it reproduced with a recent Jenkins version?

          Tuukka Mustonen added a comment - - edited

          Seeing this on the latest (v1.515). Jenkins doesn't even delete the workspace on slaves when the job is deleted.

          It's very easy to reproduce:

          1) Create a job named "A" with empty configuration
          2) Run the job "A"
          3) On slave, find the directory "A" under jenkins/workspace
          4) Rename the job "A" to "B"
          5) On slave, see that directory "A" is still there and that there is no directory "B"
          6) Re-run the job (named as "B" now)
          7) On slave, see that a new directory with name of "B" has been created. The old directory "A" is still there as well
          8) Delete job "B"
          9) On slave, see that both directories "A" and "B" are still there...

          This is a real issue when jobs are dynamically created and deleted based on branches (http://entagen.github.io/jenkins-build-per-branch/) as it causes filesystems of slaves get bloated with workspaces no longer needed.

          Tuukka Mustonen added a comment - - edited Seeing this on the latest (v1.515). Jenkins doesn't even delete the workspace on slaves when the job is deleted. It's very easy to reproduce: 1) Create a job named "A" with empty configuration 2) Run the job "A" 3) On slave, find the directory "A" under jenkins/workspace 4) Rename the job "A" to "B" 5) On slave, see that directory "A" is still there and that there is no directory "B" 6) Re-run the job (named as "B" now) 7) On slave, see that a new directory with name of "B" has been created. The old directory "A" is still there as well 8) Delete job "B" 9) On slave, see that both directories "A" and "B" are still there... This is a real issue when jobs are dynamically created and deleted based on branches ( http://entagen.github.io/jenkins-build-per-branch/ ) as it causes filesystems of slaves get bloated with workspaces no longer needed.

          Andreas Horst added a comment -

          Reproducible on 1.573 (not tested job deletion; only renaming).

          Andreas Horst added a comment - Reproducible on 1.573 (not tested job deletion; only renaming).

          Roman80 added a comment -

          Reproducible on 1.611 with job deletion too

          Roman80 added a comment - Reproducible on 1.611 with job deletion too

            kohsuke Kohsuke Kawaguchi
            vultron81 Ben Williams
            Votes:
            11 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: