[JIRA] (JENKINS-56643) hudson.Util.createSymlink is not atomic which means lastSuccessfulBuild updates are not atomic

2 views
Skip to first unread message

jsoref+jenkins@gmail.com (JIRA)

unread,
Mar 20, 2019, 4:09:03 PM3/20/19
to jenkinsc...@googlegroups.com
Josh Soref created an issue
 
Jenkins / Bug JENKINS-56643
hudson.Util.createSymlink is not atomic which means lastSuccessfulBuild updates are not atomic
Issue Type: Bug Bug
Assignee: Josh Soref
Components: core
Created: 2019-03-20 20:08
Priority: Minor Minor
Reporter: Josh Soref
    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

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

dbeck@cloudbees.com (JIRA)

unread,
Mar 30, 2020, 7:20:05 AM3/30/20
to jenkinsc...@googlegroups.com
Daniel Beck resolved as Fixed
Change By: Daniel Beck
Status: Open Resolved
Resolution: Fixed
Released As: Jenkins 2.229
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages