{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments/84788675","pull_request_review_id":5544096,"id":84788675,"diff_hunk":"@@ -103,34 +122,45 @@ public void close() throws IOException {\n      */\n     public void abort() throws IOException {\n         close();\n-        tmpFile.delete();\n+        Files.deleteIfExists(tmpFile);\n     }\n \n     public void commit() throws IOException {\n         close();\n-        if (destFile.exists()) {\n-            try {\n-                Util.deleteFile(destFile);\n-            } catch (IOException x) {\n-                tmpFile.delete();\n-                throw x;\n-            }\n+        try {\n+            // Try to make an atomic move.\n+            Files.move(tmpFile, destFile, StandardCopyOption.ATOMIC_MOVE);\n+        } catch (AtomicMoveNotSupportedException e) {","path":"core/src/main/java/hudson/util/AtomicFileWriter.java","position":88,"original_position":88,"commit_id":"2df07337ed4ca894c85f2bd90da9f1e1290f8439","original_commit_id":"2df07337ed4ca894c85f2bd90da9f1e1290f8439","user":{"login":"jtnord","id":494726,"avatar_url":"https://avatars.githubusercontent.com/u/494726?v=3","gravatar_id":"","url":"https://api.github.com/users/jtnord","html_url":"https://github.com/jtnord","followers_url":"https://api.github.com/users/jtnord/followers","following_url":"https://api.github.com/users/jtnord/following{/other_user}","gists_url":"https://api.github.com/users/jtnord/gists{/gist_id}","starred_url":"https://api.github.com/users/jtnord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtnord/subscriptions","organizations_url":"https://api.github.com/users/jtnord/orgs","repos_url":"https://api.github.com/users/jtnord/repos","events_url":"https://api.github.com/users/jtnord/events{/privacy}","received_events_url":"https://api.github.com/users/jtnord/received_events","type":"User","site_admin":false},"body":"Looks like this was changed and introduced a :bug:","created_at":"2016-10-24T21:33:19Z","updated_at":"2016-10-24T21:36:16Z","html_url":"https://github.com/jenkinsci/jenkins/pull/2548#discussion_r84788675","pull_request_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/2548","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments/84788675"},"html":{"href":"https://github.com/jenkinsci/jenkins/pull/2548#discussion_r84788675"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/2548"}}},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/2548","id":85666759,"html_url":"https://github.com/jenkinsci/jenkins/pull/2548","diff_url":"https://github.com/jenkinsci/jenkins/pull/2548.diff","patch_url":"https://github.com/jenkinsci/jenkins/pull/2548.patch","issue_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/2548","number":2548,"state":"open","locked":false,"title":"[JENKINS-34855] AtomicWriteFile is not Atomic","user":{"login":"christ66","id":1302212,"avatar_url":"https://avatars.githubusercontent.com/u/1302212?v=3","gravatar_id":"","url":"https://api.github.com/users/christ66","html_url":"https://github.com/christ66","followers_url":"https://api.github.com/users/christ66/followers","following_url":"https://api.github.com/users/christ66/following{/other_user}","gists_url":"https://api.github.com/users/christ66/gists{/gist_id}","starred_url":"https://api.github.com/users/christ66/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christ66/subscriptions","organizations_url":"https://api.github.com/users/christ66/orgs","repos_url":"https://api.github.com/users/christ66/repos","events_url":"https://api.github.com/users/christ66/events{/privacy}","received_events_url":"https://api.github.com/users/christ66/received_events","type":"User","site_admin":false},"body":"[JENKINS-34855](https://issues.jenkins-ci.org/browse/JENKINS-34855)\r\n\r\nIn certain cases the `AtomicWriteFile` is not `Atomic`. In a rare case you can perform a restart in the middle of a move operation, and on disk you will end up with a `0` byte file because the move operation happened in memory, but failed to be written to disk. We need to make sure that these operations are properly synced with disk.\r\n\r\n@reviewbybees esp. @jtnord ","created_at":"2016-09-17T07:19:40Z","updated_at":"2016-10-24T21:36:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"edede893a8bcf1f93fc666513505a5bde160561e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/2548/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/2548/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/2548/comments","statuses_url":"https://api.github.com/repos/jenkinsci/jenkins/statuses/2df07337ed4ca894c85f2bd90da9f1e1290f8439","head":{"label":"christ66:JENKINS-34855","ref":"JENKINS-34855","sha":"2df07337ed4ca894c85f2bd90da9f1e1290f8439","user":{"login":"christ66","id":1302212,"avatar_url":"https://avatars.githubusercontent.com/u/1302212?v=3","gravatar_id":"","url":"https://api.github.com/users/christ66","html_url":"https://github.com/christ66","followers_url":"https://api.github.com/users/christ66/followers","following_url":"https://api.github.com/users/christ66/following{/other_user}","gists_url":"https://api.github.com/users/christ66/gists{/gist_id}","starred_url":"https://api.github.com/users/christ66/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christ66/subscriptions","organizations_url":"https://api.github.com/users/christ66/orgs","repos_url":"https://api.github.com/users/christ66/repos","events_url":"https://api.github.com/users/christ66/events{/privacy}","received_events_url":"https://api.github.com/users/christ66/received_events","type":"User","site_admin":false},"repo":{"id":16967504,"name":"jenkins","full_name":"christ66/jenkins","owner":{"login":"christ66","id":1302212,"avatar_url":"https://avatars.githubusercontent.com/u/1302212?v=3","gravatar_id":"","url":"https://api.github.com/users/christ66","html_url":"https://github.com/christ66","followers_url":"https://api.github.com/users/christ66/followers","following_url":"https://api.github.com/users/christ66/following{/other_user}","gists_url":"https://api.github.com/users/christ66/gists{/gist_id}","starred_url":"https://api.github.com/users/christ66/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christ66/subscriptions","organizations_url":"https://api.github.com/users/christ66/orgs","repos_url":"https://api.github.com/users/christ66/repos","events_url":"https://api.github.com/users/christ66/events{/privacy}","received_events_url":"https://api.github.com/users/christ66/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/christ66/jenkins","description":"Jenkins Continuous Integration Server","fork":true,"url":"https://api.github.com/repos/christ66/jenkins","forks_url":"https://api.github.com/repos/christ66/jenkins/forks","keys_url":"https://api.github.com/repos/christ66/jenkins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/christ66/jenkins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/christ66/jenkins/teams","hooks_url":"https://api.github.com/repos/christ66/jenkins/hooks","issue_events_url":"https://api.github.com/repos/christ66/jenkins/issues/events{/number}","events_url":"https://api.github.com/repos/christ66/jenkins/events","assignees_url":"https://api.github.com/repos/christ66/jenkins/assignees{/user}","branches_url":"https://api.github.com/repos/christ66/jenkins/branches{/branch}","tags_url":"https://api.github.com/repos/christ66/jenkins/tags","blobs_url":"https://api.github.com/repos/christ66/jenkins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/christ66/jenkins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/christ66/jenkins/git/refs{/sha}","trees_url":"https://api.github.com/repos/christ66/jenkins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/christ66/jenkins/statuses/{sha}","languages_url":"https://api.github.com/repos/christ66/jenkins/languages","stargazers_url":"https://api.github.com/repos/christ66/jenkins/stargazers","contributors_url":"https://api.github.com/repos/christ66/jenkins/contributors","subscribers_url":"https://api.github.com/repos/christ66/jenkins/subscribers","subscription_url":"https://api.github.com/repos/christ66/jenkins/subscription","commits_url":"https://api.github.com/repos/christ66/jenkins/commits{/sha}","git_commits_url":"https://api.github.com/repos/christ66/jenkins/git/commits{/sha}","comments_url":"https://api.github.com/repos/christ66/jenkins/comments{/number}","issue_comment_url":"https://api.github.com/repos/christ66/jenkins/issues/comments{/number}","contents_url":"https://api.github.com/repos/christ66/jenkins/contents/{+path}","compare_url":"https://api.github.com/repos/christ66/jenkins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/christ66/jenkins/merges","archive_url":"https://api.github.com/repos/christ66/jenkins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/christ66/jenkins/downloads","issues_url":"https://api.github.com/repos/christ66/jenkins/issues{/number}","pulls_url":"https://api.github.com/repos/christ66/jenkins/pulls{/number}","milestones_url":"https://api.github.com/repos/christ66/jenkins/milestones{/number}","notifications_url":"https://api.github.com/repos/christ66/jenkins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/christ66/jenkins/labels{/name}","releases_url":"https://api.github.com/repos/christ66/jenkins/releases{/id}","deployments_url":"https://api.github.com/repos/christ66/jenkins/deployments","created_at":"2014-02-18T23:19:43Z","updated_at":"2015-04-17T18:22:51Z","pushed_at":"2016-09-23T17:01:28Z","git_url":"git://github.com/christ66/jenkins.git","ssh_url":"git@github.com:christ66/jenkins.git","clone_url":"https://github.com/christ66/jenkins.git","svn_url":"https://github.com/christ66/jenkins","homepage":"http://jenkins-ci.org/","size":93859,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jenkinsci:master","ref":"master","sha":"307095b758bcf04c392abf7c78b50556393c86a1","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":1103607,"name":"jenkins","full_name":"jenkinsci/jenkins","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/jenkins","description":"Jenkins Continuous Integration Server","fork":true,"url":"https://api.github.com/repos/jenkinsci/jenkins","forks_url":"https://api.github.com/repos/jenkinsci/jenkins/forks","keys_url":"https://api.github.com/repos/jenkinsci/jenkins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/jenkins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/jenkins/teams","hooks_url":"https://api.github.com/repos/jenkinsci/jenkins/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/jenkins/events","assignees_url":"https://api.github.com/repos/jenkinsci/jenkins/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/jenkins/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/jenkins/tags","blobs_url":"https://api.github.com/repos/jenkinsci/jenkins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/jenkins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/jenkins/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/jenkins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/jenkins/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/jenkins/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/jenkins/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/jenkins/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/jenkins/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/jenkins/subscription","commits_url":"https://api.github.com/repos/jenkinsci/jenkins/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/jenkins/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/jenkins/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/jenkins/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/jenkins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/jenkins/merges","archive_url":"https://api.github.com/repos/jenkinsci/jenkins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/jenkins/downloads","issues_url":"https://api.github.com/repos/jenkinsci/jenkins/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/jenkins/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/jenkins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/jenkins/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/jenkins/releases{/id}","deployments_url":"https://api.github.com/repos/jenkinsci/jenkins/deployments","created_at":"2010-11-22T21:21:23Z","updated_at":"2016-10-24T19:52:05Z","pushed_at":"2016-10-24T19:43:30Z","git_url":"git://github.com/jenkinsci/jenkins.git","ssh_url":"git@github.com:jenkinsci/jenkins.git","clone_url":"https://github.com/jenkinsci/jenkins.git","svn_url":"https://github.com/jenkinsci/jenkins","homepage":"https://jenkins.io/","size":141700,"stargazers_count":6873,"watchers_count":6873,"language":"Java","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":2897,"mirror_url":null,"open_issues_count":113,"forks":2897,"open_issues":113,"watchers":6873,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/2548"},"html":{"href":"https://github.com/jenkinsci/jenkins/pull/2548"},"issue":{"href":"https://api.github.com/repos/jenkinsci/jenkins/issues/2548"},"comments":{"href":"https://api.github.com/repos/jenkinsci/jenkins/issues/2548/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/2548/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/2548/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/jenkins/statuses/2df07337ed4ca894c85f2bd90da9f1e1290f8439"}}}}
{"actor":{"display_login":"jtnord"}}