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

WorkspaceCleanupThread deletes Matrix project workspaces

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Major Major
    • core
    • None
    • Platform: All, OS: All

      Problem:
      A matrix project is set up to build on several slave nodes.
      Its workspace directory is cleaned at slaves even if there is a running build.

      Description:
      WorkspaceCleanupThread uses shouldBeDeleted method to determine should the
      workspace be deleted or not. It checks:
      1) was the workspace directory modified at least 30 days ago;
      2) was the project last built on the specific node.

      Matrix project workspace directory contains axis subdirectories, therefore it is
      not touched by a build. So the 1st check is passed.
      Matrix project build node points to the master. So the 2nd check is passed for a
      slave.
      So a matrix project workspace is deleted after 30 days since last axis
      configuration change.

          [JENKINS-4501] WorkspaceCleanupThread deletes Matrix project workspaces

          mdonohue added a comment -

          Also see issue 3841.

          mdonohue added a comment - Also see issue 3841.

          Daniel Beck added a comment -

          This needs to be confirmed to still be an issue on 1.551+ which changed how the workspace cleanup works.

          Daniel Beck added a comment - This needs to be confirmed to still be an issue on 1.551+ which changed how the workspace cleanup works.

          Daniel Beck added a comment -

          Resolving as 'Incomplete' after no response to comment asking for updated information in over two weeks.

          Due to the age of this issue, please file a new issue if this still occurs on recent Jenkins versions.

          Daniel Beck added a comment - Resolving as 'Incomplete' after no response to comment asking for updated information in over two weeks. Due to the age of this issue, please file a new issue if this still occurs on recent Jenkins versions.

          I have the same issue on

          • Jenkins ver. 1.569
          • Tomcat7

          all my workspaces on a slave have been deleted:

          (updating existing workspace as expected )

          04.01.2015 01:23:20 Building remotely on machine-02 in workspace /path/to/jenkins-slave/workspace/DevOps-vagrant-up-paybackce-matrix-test1-CI/label/machine-02/vb_name/test1-cae-extint-1
          04.01.2015 01:23:21 Updating http://..../vagrant/trunk at revision '2015-01-04T01:22:00.296 +0100'
          

          WorkspaceCleanupThread was executed

          Jan 04, 2015 12:47:27 PM hudson.model.AsyncPeriodicWork$1 run
          INFO: Started Workspace clean-up
          Jan 04, 2015 12:47:30 PM hudson.model.AsyncPeriodicWork$1 run
          INFO: Finished Workspace clean-up. 3,457 ms
          Jan 04, 2015 12:57:16 PM hudson.model.Run execute
          

          (checking out new workspace - unexpected and leads to errors)

          05.01.2015 01:22:22 Building remotely on machine-02 in workspace /path/to/jenkins-slave/workspace/DevOps-vagrant-up-paybackce-matrix-test1-CI/label/machine-02/vb_name/test1-cae-extint-1
          05.01.2015 01:22:23 Checking out a fresh workspace because there's no workspace at /path/to/jenkins-slave/workspace/DevOps-vagrant-up-paybackce-matrix-test1-CI/label/machine-02/vb_name/test1-cae-extint-1
          

          I re-opened the issue so all information is in here now, I hope you agree.

          Torsten Reinhard added a comment - I have the same issue on Jenkins ver. 1.569 Tomcat7 all my workspaces on a slave have been deleted: (updating existing workspace as expected ) 04.01.2015 01:23:20 Building remotely on machine-02 in workspace /path/to/jenkins-slave/workspace/DevOps-vagrant-up-paybackce-matrix-test1-CI/label/machine-02/vb_name/test1-cae-extint-1 04.01.2015 01:23:21 Updating http: //..../vagrant/trunk at revision '2015-01-04T01:22:00.296 +0100' WorkspaceCleanupThread was executed Jan 04, 2015 12:47:27 PM hudson.model.AsyncPeriodicWork$1 run INFO: Started Workspace clean-up Jan 04, 2015 12:47:30 PM hudson.model.AsyncPeriodicWork$1 run INFO: Finished Workspace clean-up. 3,457 ms Jan 04, 2015 12:57:16 PM hudson.model.Run execute (checking out new workspace - unexpected and leads to errors) 05.01.2015 01:22:22 Building remotely on machine-02 in workspace /path/to/jenkins-slave/workspace/DevOps-vagrant-up-paybackce-matrix-test1-CI/label/machine-02/vb_name/test1-cae-extint-1 05.01.2015 01:22:23 Checking out a fresh workspace because there's no workspace at /path/to/jenkins-slave/workspace/DevOps-vagrant-up-paybackce-matrix-test1-CI/label/machine-02/vb_name/test1-cae-extint-1 I re-opened the issue so all information is in here now, I hope you agree.

          Daniel Beck added a comment -

          Please file a new issue as I requested above. The behavior of workspace cleanup was completely rewritten in 1.551, so whatever's wrong in later versions is likely unrelated to this report.

          That said, 1.569 is over half a year old and too old for new issue reports. I hope that's just a typo.

          Make sure to create a log recorder for the logger hudson.model.WorkspaceCleanupThread on level ALL to find out what it actually does (https://wiki.jenkins-ci.org/display/JENKINS/Logging). "Deleted all workspaces" doesn't look like the cleanup thread's behavior at all.

          Resolving as incomplete again.

          Daniel Beck added a comment - Please file a new issue as I requested above. The behavior of workspace cleanup was completely rewritten in 1.551, so whatever's wrong in later versions is likely unrelated to this report. That said, 1.569 is over half a year old and too old for new issue reports. I hope that's just a typo. Make sure to create a log recorder for the logger hudson.model.WorkspaceCleanupThread on level ALL to find out what it actually does ( https://wiki.jenkins-ci.org/display/JENKINS/Logging ). "Deleted all workspaces" doesn't look like the cleanup thread's behavior at all. Resolving as incomplete again.

          See new issue JENKINS-27329

          Matthew Webber added a comment - See new issue JENKINS-27329

            Unassigned Unassigned
            kirill_evstigneev Kirill Evstigneev
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: