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

all fingerprints are kept forever if any builds are "kept forever"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • fingerprint-plugin
    • None

      We notice that if any builds are marked "kept forever", all the newer fingerprints from the newer builds of that job will also be kept forever, even if the build itself are cleaned.

       

      This can be seen in the code here:

      https://github.com/jenkinsci/jenkins/blob/a0faeaee3cbcd2709b6ffb4491e31928b1d234d5/core/src/main/java/hudson/model/Fingerprint.java#L1058

       

       public synchronized boolean isAlive() {
          if (original != null && original.isAlive())
              return true;    for (Map.Entry<String, RangeSet> e : usages.entrySet()) {
              Job j = Jenkins.get().getItemByFullName(e.getKey(), Job.class);
              if (j == null)
                  continue;        
              Run firstBuild = j.getFirstBuild();
              if (firstBuild == null)
                  continue;        
              int oldest = firstBuild.getNumber();
              if (!e.getValue().isSmallerThan(oldest))
                  return true;
          }
          return false;
      }

      isAlive returns true if the firstBuild number is older than the fingerprint, this mean, if there are any kept builds, all the fingerprints in the newer builds will also be kept forever.

      My jenkins instance today ran out of inodes due to this issue.

            marcsanfacon Marc Sanfacon
            slcy sam leung
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: