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

Introduce directory disposal service

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Won't Fix
    • core
    • None

    Description

      Jenkins discards directories that are not needed any longer all the time. Aside from the fact it is subject of different random failures (on windows, on NFS, etc.), it is also a time consuming operation.

      Instead of deleting such files synchronously, I propose to create Jenkins-wide service where directories can be registered for later disposal. The service will rename the directory so it will appear deleted immediately and delete the renamed one later.

      Similar approach is implemented in Workspace cleanup plugin though the solution leaks renamed directories in case the deletion fails.

      Such service will track registered directories even after the deletion failed and retry as many times as necessary or possibly report to admin that there is a problem Jenkins itself cannot handle despite repeated attempts.

      There are several areas that can benefit from this aside from Workspace cleanup. though, I am not sure if this behaviour should replace what FilePath#deleteRecursive currently does.

      Attachments

        Issue Links

          Activity

            olivergondza Oliver Gondža added a comment - https://github.com/jenkinsci/jenkins/pull/1636

            This appears to be unnecessarily complicated.

            olivergondza Oliver Gondža added a comment - This appears to be unnecessarily complicated.
            danielbeck Daniel Beck added a comment -

            FWIW this could be interesting if we ever move to a 'Recycle Bin'/delayed deletion model for deleting builds/jobs.

            danielbeck Daniel Beck added a comment - FWIW this could be interesting if we ever move to a 'Recycle Bin'/delayed deletion model for deleting builds/jobs.
            olivergondza Oliver Gondža added a comment - - edited

            danielbeck, I have seen UI threads timeout deleting jobs while waiting on FS. Which is something my PR would address.

            olivergondza Oliver Gondža added a comment - - edited danielbeck , I have seen UI threads timeout deleting jobs while waiting on FS. Which is something my PR would address.

            People

              olivergondza Oliver Gondža
              olivergondza Oliver Gondža
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: