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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Similar Issues:
    • Released As:
      Jenkins 2.229

      Description

          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

        Attachments

          Issue Links

            Activity

            There are no comments yet on this issue.

              People

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

                Dates

                Created:
                Updated:
                Resolved: