{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/pulls/comments/42727745","id":42727745,"diff_hunk":"@@ -0,0 +1,31 @@\n+package org.jenkinsci.plugins.uniqueid.impl;\n+\n+import hudson.model.Run;\n+import jenkins.model.RunAction2;\n+\n+public class LongLoadingAction implements RunAction2 {\n+\n+    public String getIconFileName() {\n+        return null;\n+    }\n+\n+    public String getDisplayName() {\n+        return null;\n+    }\n+\n+    public String getUrlName() {\n+        return null;\n+    }\n+\n+    public void onAttached(Run<?, ?> r) {\n+    }\n+\n+    public void onLoad(Run<?, ?> r) {\n+        try {\n+            Thread.sleep(1000);","path":"src/test/java/org/jenkinsci/plugins/uniqueid/impl/LongLoadingAction.java","position":25,"original_position":25,"commit_id":"be2ed91326c6812389feaa5c496494eb835c459c","original_commit_id":"c2552cd0a5d8c5fcca6730559e416382ff0d2c8b","user":{"login":"tfennelly","id":429311,"avatar_url":"https://avatars.githubusercontent.com/u/429311?v=3","gravatar_id":"","url":"https://api.github.com/users/tfennelly","html_url":"https://github.com/tfennelly","followers_url":"https://api.github.com/users/tfennelly/followers","following_url":"https://api.github.com/users/tfennelly/following{/other_user}","gists_url":"https://api.github.com/users/tfennelly/gists{/gist_id}","starred_url":"https://api.github.com/users/tfennelly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfennelly/subscriptions","organizations_url":"https://api.github.com/users/tfennelly/orgs","repos_url":"https://api.github.com/users/tfennelly/repos","events_url":"https://api.github.com/users/tfennelly/events{/privacy}","received_events_url":"https://api.github.com/users/tfennelly/received_events","type":"User","site_admin":false},"body":"I can see how sleeping indefinitely (inside a loop) is a bad thing, but this seems fine to me, even if I don't know why it's there (mimic a load delay or something?).","created_at":"2015-10-22T09:30:32Z","updated_at":"2015-10-22T09:30:32Z","html_url":"https://github.com/jenkinsci/unique-id-plugin/pull/8#discussion_r42727745","pull_request_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/unique-id-plugin/pulls/comments/42727745"},"html":{"href":"https://github.com/jenkinsci/unique-id-plugin/pull/8#discussion_r42727745"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/unique-id-plugin/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/pulls/8","id":48382475,"html_url":"https://github.com/jenkinsci/unique-id-plugin/pull/8","diff_url":"https://github.com/jenkinsci/unique-id-plugin/pull/8.diff","patch_url":"https://github.com/jenkinsci/unique-id-plugin/pull/8.patch","issue_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/issues/8","number":8,"state":"open","locked":false,"title":"[JENKINS-30424] Move build.save to the migration thread","user":{"login":"amuniz","id":1017585,"avatar_url":"https://avatars.githubusercontent.com/u/1017585?v=3","gravatar_id":"","url":"https://api.github.com/users/amuniz","html_url":"https://github.com/amuniz","followers_url":"https://api.github.com/users/amuniz/followers","following_url":"https://api.github.com/users/amuniz/following{/other_user}","gists_url":"https://api.github.com/users/amuniz/gists{/gist_id}","starred_url":"https://api.github.com/users/amuniz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amuniz/subscriptions","organizations_url":"https://api.github.com/users/amuniz/orgs","repos_url":"https://api.github.com/users/amuniz/repos","events_url":"https://api.github.com/users/amuniz/events{/privacy}","received_events_url":"https://api.github.com/users/amuniz/received_events","type":"User","site_admin":false},"body":"[JENKINS-30424](https://issues.jenkins-ci.org/browse/JENKINS-30424)\r\n\r\nMove build.save to the migration thread (avoiding to save the build before it is loaded), and keep the save on `Id.onLoad` but limit its effect if the migration thread did not finish yet.\r\n\r\nTest added. Confirmed the test failing with current master with the following exception (and working after this fix):\r\n\r\n```\r\nException in thread \"unique-id background migration thread\" org.jenkinsci.plugins.uniqueid.impl.IdStoreMigratorV1ToV2$IDStoreMigrationException: Failure whilst migrating folderWithID » jobWithID #2\r\n\tat org.jenkinsci.plugins.uniqueid.impl.IdStoreMigratorV1ToV2.migrate(IdStoreMigratorV1ToV2.java:100)\r\n\tat org.jenkinsci.plugins.uniqueid.impl.Id.onLoad(Id.java:78)\r\n\tat hudson.model.Run.onLoad(Run.java:345)\r\n\tat org.jenkinsci.plugins.uniqueid.impl.LongLoadingBuild.onLoad(LongLoadingBuild.java:29)\r\n\tat hudson.model.RunMap.retrieve(RunMap.java:223)\r\n\tat hudson.model.RunMap.retrieve(RunMap.java:59)\r\n\tat jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:687)\r\n\tat jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:670)\r\n\tat jenkins.model.lazy.AbstractLazyLoadRunMap.all(AbstractLazyLoadRunMap.java:622)\r\n\tat jenkins.model.lazy.AbstractLazyLoadRunMap.entrySet(AbstractLazyLoadRunMap.java:277)\r\n\tat java.util.AbstractMap$2$1.<init>(AbstractMap.java:389)\r\n\tat java.util.AbstractMap$2.iterator(AbstractMap.java:388)\r\n\tat hudson.util.RunList.iterator(RunList.java:97)\r\n\tat org.jenkinsci.plugins.uniqueid.impl.IdStoreMigratorV1ToV2$RunIDMigrationThread.run(IdStoreMigratorV1ToV2.java:134)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\nCaused by: java.lang.NullPointerException\r\n\tat org.jenkinsci.plugins.uniqueid.impl.LongLoadingBuild.save(LongLoadingBuild.java:23)\r\n\tat org.jenkinsci.plugins.uniqueid.impl.RunIdStore.remove(RunIdStore.java:33)\r\n```\r\n\r\n@reviewbybees (esp. @jtnord)","created_at":"2015-10-21T20:21:53Z","updated_at":"2015-10-22T09:30:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a5ef005861852a617933d8ffa35d7dcded04df82","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/pulls/8/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/pulls/8/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/issues/8/comments","statuses_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/statuses/be2ed91326c6812389feaa5c496494eb835c459c","head":{"label":"amuniz:JENKINS-30424","ref":"JENKINS-30424","sha":"be2ed91326c6812389feaa5c496494eb835c459c","user":{"login":"amuniz","id":1017585,"avatar_url":"https://avatars.githubusercontent.com/u/1017585?v=3","gravatar_id":"","url":"https://api.github.com/users/amuniz","html_url":"https://github.com/amuniz","followers_url":"https://api.github.com/users/amuniz/followers","following_url":"https://api.github.com/users/amuniz/following{/other_user}","gists_url":"https://api.github.com/users/amuniz/gists{/gist_id}","starred_url":"https://api.github.com/users/amuniz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amuniz/subscriptions","organizations_url":"https://api.github.com/users/amuniz/orgs","repos_url":"https://api.github.com/users/amuniz/repos","events_url":"https://api.github.com/users/amuniz/events{/privacy}","received_events_url":"https://api.github.com/users/amuniz/received_events","type":"User","site_admin":false},"repo":{"id":44664858,"name":"unique-id-plugin","full_name":"amuniz/unique-id-plugin","owner":{"login":"amuniz","id":1017585,"avatar_url":"https://avatars.githubusercontent.com/u/1017585?v=3","gravatar_id":"","url":"https://api.github.com/users/amuniz","html_url":"https://github.com/amuniz","followers_url":"https://api.github.com/users/amuniz/followers","following_url":"https://api.github.com/users/amuniz/following{/other_user}","gists_url":"https://api.github.com/users/amuniz/gists{/gist_id}","starred_url":"https://api.github.com/users/amuniz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amuniz/subscriptions","organizations_url":"https://api.github.com/users/amuniz/orgs","repos_url":"https://api.github.com/users/amuniz/repos","events_url":"https://api.github.com/users/amuniz/events{/privacy}","received_events_url":"https://api.github.com/users/amuniz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/amuniz/unique-id-plugin","description":"","fork":true,"url":"https://api.github.com/repos/amuniz/unique-id-plugin","forks_url":"https://api.github.com/repos/amuniz/unique-id-plugin/forks","keys_url":"https://api.github.com/repos/amuniz/unique-id-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amuniz/unique-id-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amuniz/unique-id-plugin/teams","hooks_url":"https://api.github.com/repos/amuniz/unique-id-plugin/hooks","issue_events_url":"https://api.github.com/repos/amuniz/unique-id-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/amuniz/unique-id-plugin/events","assignees_url":"https://api.github.com/repos/amuniz/unique-id-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/amuniz/unique-id-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/amuniz/unique-id-plugin/tags","blobs_url":"https://api.github.com/repos/amuniz/unique-id-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amuniz/unique-id-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amuniz/unique-id-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/amuniz/unique-id-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amuniz/unique-id-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/amuniz/unique-id-plugin/languages","stargazers_url":"https://api.github.com/repos/amuniz/unique-id-plugin/stargazers","contributors_url":"https://api.github.com/repos/amuniz/unique-id-plugin/contributors","subscribers_url":"https://api.github.com/repos/amuniz/unique-id-plugin/subscribers","subscription_url":"https://api.github.com/repos/amuniz/unique-id-plugin/subscription","commits_url":"https://api.github.com/repos/amuniz/unique-id-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/amuniz/unique-id-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/amuniz/unique-id-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/amuniz/unique-id-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/amuniz/unique-id-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/amuniz/unique-id-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amuniz/unique-id-plugin/merges","archive_url":"https://api.github.com/repos/amuniz/unique-id-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amuniz/unique-id-plugin/downloads","issues_url":"https://api.github.com/repos/amuniz/unique-id-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/amuniz/unique-id-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/amuniz/unique-id-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/amuniz/unique-id-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amuniz/unique-id-plugin/labels{/name}","releases_url":"https://api.github.com/repos/amuniz/unique-id-plugin/releases{/id}","created_at":"2015-10-21T09:08:11Z","updated_at":"2015-10-21T09:08:12Z","pushed_at":"2015-10-22T08:03:32Z","git_url":"git://github.com/amuniz/unique-id-plugin.git","ssh_url":"git@github.com:amuniz/unique-id-plugin.git","clone_url":"https://github.com/amuniz/unique-id-plugin.git","svn_url":"https://github.com/amuniz/unique-id-plugin","homepage":null,"size":146,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"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":"d922d1c0dfaa28c5c27497448d2ced5b065110d3","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":26029776,"name":"unique-id-plugin","full_name":"jenkinsci/unique-id-plugin","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/unique-id-plugin","description":"","fork":true,"url":"https://api.github.com/repos/jenkinsci/unique-id-plugin","forks_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/forks","keys_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/teams","hooks_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/events","assignees_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/tags","blobs_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/subscription","commits_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/merges","archive_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/downloads","issues_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/unique-id-plugin/releases{/id}","created_at":"2014-10-31T19:11:57Z","updated_at":"2014-10-31T19:29:40Z","pushed_at":"2015-10-22T08:03:33Z","git_url":"git://github.com/jenkinsci/unique-id-plugin.git","ssh_url":"git@github.com:jenkinsci/unique-id-plugin.git","clone_url":"https://github.com/jenkinsci/unique-id-plugin.git","svn_url":"https://github.com/jenkinsci/unique-id-plugin","homepage":null,"size":297,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/unique-id-plugin/pulls/8"},"html":{"href":"https://github.com/jenkinsci/unique-id-plugin/pull/8"},"issue":{"href":"https://api.github.com/repos/jenkinsci/unique-id-plugin/issues/8"},"comments":{"href":"https://api.github.com/repos/jenkinsci/unique-id-plugin/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/unique-id-plugin/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/unique-id-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/unique-id-plugin/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/unique-id-plugin/statuses/be2ed91326c6812389feaa5c496494eb835c459c"}}}}