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

hudson.Util.createSymlink is not atomic which means lastSuccessfulBuild updates are not atomic

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None
    • Jenkins 2.229

          public static void createSymlink(@Nonnull File baseDir, @Nonnull String targetPath,            @Nonnull String symlinkPath, @Nonnull TaskListener listener) throws InterruptedException { 

      https://github.com/jenkinsci/jenkins/blob/5562b2fec6428b730a7b88ad6390a7ed741ba792/core/src/main/java/hudson/Util.java#L1192

                      Files.deleteIfExists(path); 

      https://github.com/jenkinsci/jenkins/blob/5562b2fec6428b730a7b88ad6390a7ed741ba792/core/src/main/java/hudson/Util.java#L1194

                          Files.createSymbolicLink(path, target); 

       

      Called from:

      jenkins.model.PeepholePermalink.updateCache

      https://github.com/jenkinsci/jenkins/blob/22aa2e6e766074d11249893e3f35e0b99e20d3d0/core/src/main/java/jenkins/model/PeepholePermalink.java#L148

                      // (re)create the build Number->Id symlink
                      Util.createSymlink(job.getBuildDir(),b.getId(),target,TaskListener.NULL); 

      Related to:

      hudson.model.PermalinkProjectAction.Permalink

      https://github.com/jenkinsci/jenkins/blob/22aa2e6e766074d11249893e3f35e0b99e20d3d0/core/src/main/java/hudson/model/PermalinkProjectAction.java#L129

            jsoref Josh Soref
            jsoref Josh Soref
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: