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

WorkspaceCleanupThread will delete custom workspaces in the workspace directory

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None
    • Hudson 1.376

      If the custom workspace option is chosen, and the custom workspace directory is chosen to be in the workspace directory, the WorkspaceCleanupThread (if enabled) will always delete this directory, believing it's not associated with any job.

      To reproduce:

      • Create a job with a platform-appropriate path to a custom workspace in the workspace directory, e.g. workspace\custom
      • Run a build to populate the workspace.
      • Invoke the WorkspaceCleanupThread.
      • The workspace will be deleted. Fine logs will show something like:
        Feb 23, 2011 5:20:55 PM hudson.model.WorkspaceCleanupThread
        FINE: Directory d:\dev\hudsonBuilds\workspace\custom is not owned by any project
        

      Workaround is to not create custom workspaces in the workspace directory.

          [JENKINS-8880] WorkspaceCleanupThread will delete custom workspaces in the workspace directory

          nitin pat added a comment -

          I am unable to understand "the workspace directory is chosen to be in the workspace directory".... Can you please elaborate on this...

          Also correct me if am wrong are there 2 kinds of workspaces

          1) Workspace under remote FS root
          2) Workspace under a job

          If thats true does the issue apply to both. I am seeing this problem in both cases. So please give an example of wghat the custom workspace should be like. Will it be alrite to just have a Custom WS not under the slave root (hudson Root) workspace or the JOb workspace? Please let me know..

          -Nitin

          nitin pat added a comment - I am unable to understand "the workspace directory is chosen to be in the workspace directory".... Can you please elaborate on this... Also correct me if am wrong are there 2 kinds of workspaces 1) Workspace under remote FS root 2) Workspace under a job If thats true does the issue apply to both. I am seeing this problem in both cases. So please give an example of wghat the custom workspace should be like. Will it be alrite to just have a Custom WS not under the slave root (hudson Root) workspace or the JOb workspace? Please let me know.. -Nitin

          oeuftete added a comment -

          Nitin, I've updated the part of the description you quoted to be clearer. Your question (although I don't understand it clearly) sounds appropriate for asking on the users list, and not in this JIRA issue.

          oeuftete added a comment - Nitin, I've updated the part of the description you quoted to be clearer. Your question (although I don't understand it clearly) sounds appropriate for asking on the users list, and not in this JIRA issue.

          I ran into this same issue. In case it isn't clear: WorkspaceCleanupThread looks for a Job configuration with the same name as the directory of the workspace. So if a custom workspace is configured, no matching Job is found, and the code assumes this means the Job was removed and the workspace is removed.

          I submitted Pull Request #214 in GitHub to resolve this.

          https://github.com/jenkinsci/jenkins/pull/214

          Rob van Oostrum added a comment - I ran into this same issue. In case it isn't clear: WorkspaceCleanupThread looks for a Job configuration with the same name as the directory of the workspace. So if a custom workspace is configured, no matching Job is found, and the code assumes this means the Job was removed and the workspace is removed. I submitted Pull Request #214 in GitHub to resolve this. https://github.com/jenkinsci/jenkins/pull/214

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          core/src/main/java/hudson/model/WorkspaceCleanupThread.java
          http://jenkins-ci.org/commit/jenkins/39d15d9ed5898769049e00fe10d13253ae7bec8a
          Log:
          Merge pull request #214 from rvanoo/master

          [FIXED JENKINS-8880] - WorkspaceCleanupThread shouldn't simply delete custom workspace directories

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: core/src/main/java/hudson/model/WorkspaceCleanupThread.java http://jenkins-ci.org/commit/jenkins/39d15d9ed5898769049e00fe10d13253ae7bec8a Log: Merge pull request #214 from rvanoo/master [FIXED JENKINS-8880] - WorkspaceCleanupThread shouldn't simply delete custom workspace directories

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          changelog.html
          core/src/main/java/hudson/model/WorkspaceCleanupThread.java
          http://jenkins-ci.org/commit/jenkins/3a57b104c9358bfc8f818dab525785ae72eb9e64
          Log:
          changelog for JENKINS-8880 and minor follow-up changes

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: changelog.html core/src/main/java/hudson/model/WorkspaceCleanupThread.java http://jenkins-ci.org/commit/jenkins/3a57b104c9358bfc8f818dab525785ae72eb9e64 Log: changelog for JENKINS-8880 and minor follow-up changes

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          core/src/main/java/hudson/model/WorkspaceCleanupThread.java
          http://jenkins-ci.org/commit/jenkins/39d15d9ed5898769049e00fe10d13253ae7bec8a
          Log:
          Merge pull request #214 from rvanoo/master

          [FIXED JENKINS-8880] - WorkspaceCleanupThread shouldn't simply delete custom workspace directories

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: core/src/main/java/hudson/model/WorkspaceCleanupThread.java http://jenkins-ci.org/commit/jenkins/39d15d9ed5898769049e00fe10d13253ae7bec8a Log: Merge pull request #214 from rvanoo/master [FIXED JENKINS-8880] - WorkspaceCleanupThread shouldn't simply delete custom workspace directories

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          changelog.html
          core/src/main/java/hudson/model/WorkspaceCleanupThread.java
          http://jenkins-ci.org/commit/jenkins/3a57b104c9358bfc8f818dab525785ae72eb9e64
          Log:
          changelog for JENKINS-8880 and minor follow-up changes

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: changelog.html core/src/main/java/hudson/model/WorkspaceCleanupThread.java http://jenkins-ci.org/commit/jenkins/3a57b104c9358bfc8f818dab525785ae72eb9e64 Log: changelog for JENKINS-8880 and minor follow-up changes

            Unassigned Unassigned
            oeuftete oeuftete
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: