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

Workspace Cleanup does not delete @tmp directories created by libraries

      In Jenkins Pipelines one can use shared libraries. With them a additional directory is created:

      Usual-Workspace: /var/lib/jenkins/workspace/job-id/
      Additional SharedLibrary-Folder: /var/lib/jenkins/workspace/job-id@tmp

      Seems as if there the shared library sources are stored in case one want s to rerun the build.

      In order to completely wipe out old build data, a option to delete this @tmp folder could be introduced.

          [JENKINS-44909] Workspace Cleanup does not delete @tmp directories created by libraries

          moving to pipeline component as it is not a workspace.

          Oliver Gondža added a comment - moving to pipeline component as it is not a workspace.

          Closing as a duplicate of JENKINS-41805

          Baptiste Mathus added a comment - Closing as a duplicate of JENKINS-41805

          Jeff Care added a comment -

          We're hitting this now. This bug is not really a duplicate of JENKINS-41805.

          In our case, we're writing some intermediate results to the tmp area. In subsequent builds, if the correct sequence of events happen, we end up using intermediate results from old builds. This is certainly not the expected behavior. At the very least cleanWs should have the option to also clean the tmp directory associated with the workspace. I strongly argue that this bug should be reopened.

          Jeff Care added a comment - We're hitting this now. This bug is not really a duplicate of JENKINS-41805 . In our case, we're writing some intermediate results to the tmp area. In subsequent builds, if the correct sequence of events happen, we end up using intermediate results  from old builds . This is certainly not the expected behavior. At the very least cleanWs should have the option to also clean the tmp directory associated with the workspace. I strongly argue that this bug should be reopened.

          As Jeff said. This really is not a duplicate of JENKINS-41805. We have the issue that meta data is leftover in the @tmp folders which prevents subsequent checkouts with git.

          David Radoor Hummel added a comment - As Jeff said. This really is not a duplicate of JENKINS-41805 . We have the issue that meta data is leftover in the @tmp folders which prevents subsequent checkouts with git.

          David added a comment -

          +1.  Let me describe our use-case and why wsCleanup handling workspace@tmp removal would be beneficial for us:

          I am implementing a Jenkins-based CI/CD system for a reasonably large codebase.  Our workspace directories become very large after a build (8gb is not unusual), and we use several multi-branch pipelines to build different areas of our codebase.  The net result of this is that, during periods of high activity, we can rapidly exhaust the disk space available for a permanent agent within a day.  It is essential that we remove the workspace after building in the general case, though we also need the flexibility to retain workspaces when debugging build issues. I have parameterized our pipelines so that a developer can opt out of workspace deletion.

          For us, retention of @tmp directories is mostly a cosmetic issue, but it does make it more difficult to find 'real' workspace directories when navigating an agent.  I understand there are workarounds available (eg: https://issues.jenkins.io/browse/JENKINS-41805?focusedCommentId=326465&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-326465 ) but it would be really nice if this functionality was baked in.

          David added a comment - +1.  Let me describe our use-case and why wsCleanup handling workspace@tmp removal would be beneficial for us: I am implementing a Jenkins-based CI/CD system for a reasonably large codebase.  Our workspace directories become very large after a build (8gb is not unusual), and we use several multi-branch pipelines to build different areas of our codebase.  The net result of this is that, during periods of high activity, we can rapidly exhaust the disk space available for a permanent agent within a day.  It is essential that we remove the workspace after building in the general case, though we also need the flexibility to retain workspaces when debugging build issues. I have parameterized our pipelines so that a developer can opt out of workspace deletion. For us, retention of @tmp directories is mostly a cosmetic issue, but it does make it more difficult to find 'real' workspace directories when navigating an agent.  I understand there are workarounds available (eg: https://issues.jenkins.io/browse/JENKINS-41805?focusedCommentId=326465&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-326465 ) but it would be really nice if this functionality was baked in.

            Unassigned Unassigned
            dageissl Daniel Geißler
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: