{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments/28430730","id":28430730,"diff_hunk":"@@ -1372,6 +1375,18 @@ public void maintain() {\n                     makePending(p);\n                 else\n                     LOGGER.log(Level.FINE, \"BuildableItem {0} with empty work units!?\", p);\n+                                \n+                // Ensure that identification of blocked tasks is using the live state: JENKINS-27708 & JENKINS-27871\n+                // The creation of a snapshot itself should be relatively cheap given the expected rate of\n+                // job execution. You probably would need 100's of jobs starting execution every iteration\n+                // of maintain() before this could even start to become an issue and likely the calculation\n+                // of isBuildBlocked(p) will become a bottleneck before updateSnapshot() will. Additionally\n+                // since the snapshot itself only ever has at most one reference originating outside of the stack\n+                // it should remain in the eden space and thus be cheap to GC.\n+                // See https://issues.jenkins-ci.org/browse/JENKINS-27708?focusedCommentId=225819&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-225819\n+                // or https://issues.jenkins-ci.org/browse/JENKINS-27708?focusedCommentId=225906&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-225906\n+                // for alternative fixes of this issue.\n+                updateSnapshot();","path":"core/src/main/java/hudson/model/Queue.java","position":27,"original_position":27,"commit_id":"57efbea3d0326f8b24bbe458fa1d25f6f45589f8","original_commit_id":"57efbea3d0326f8b24bbe458fa1d25f6f45589f8","user":{"login":"stephenc","id":209336,"avatar_url":"https://avatars.githubusercontent.com/u/209336?v=3","gravatar_id":"","url":"https://api.github.com/users/stephenc","html_url":"https://github.com/stephenc","followers_url":"https://api.github.com/users/stephenc/followers","following_url":"https://api.github.com/users/stephenc/following{/other_user}","gists_url":"https://api.github.com/users/stephenc/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenc/subscriptions","organizations_url":"https://api.github.com/users/stephenc/orgs","repos_url":"https://api.github.com/users/stephenc/repos","events_url":"https://api.github.com/users/stephenc/events{/privacy}","received_events_url":"https://api.github.com/users/stephenc/received_events","type":"User","site_admin":false},"body":"The finally block could probably be split, so that here is the end of the inner-most finally but it would have applied a whole host of formatting changes... and given I want to have this as `lts-candidate` in the event that 1.607-1.609 are selected for the next LTS I though this was least risk","created_at":"2015-04-15T15:29:24Z","updated_at":"2015-04-15T15:29:24Z","html_url":"https://github.com/jenkinsci/jenkins/pull/1645#discussion_r28430730","pull_request_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1645","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments/28430730"},"html":{"href":"https://github.com/jenkinsci/jenkins/pull/1645#discussion_r28430730"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1645"}}},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1645","id":33145147,"html_url":"https://github.com/jenkinsci/jenkins/pull/1645","diff_url":"https://github.com/jenkinsci/jenkins/pull/1645.diff","patch_url":"https://github.com/jenkinsci/jenkins/pull/1645.patch","issue_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/1645","number":1645,"state":"closed","locked":false,"title":"JENKINS-27708, JENKINS-27871  Ensure that identification of blocked tasks is using the live state.","user":{"login":"stephenc","id":209336,"avatar_url":"https://avatars.githubusercontent.com/u/209336?v=3","gravatar_id":"","url":"https://api.github.com/users/stephenc","html_url":"https://github.com/stephenc","followers_url":"https://api.github.com/users/stephenc/followers","following_url":"https://api.github.com/users/stephenc/following{/other_user}","gists_url":"https://api.github.com/users/stephenc/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenc/subscriptions","organizations_url":"https://api.github.com/users/stephenc/orgs","repos_url":"https://api.github.com/users/stephenc/repos","events_url":"https://api.github.com/users/stephenc/events{/privacy}","received_events_url":"https://api.github.com/users/stephenc/received_events","type":"User","site_admin":false},"body":"- The creation of a snapshot itself should be relatively cheap given the expected rate of job execution. You probably would need 100's of jobs starting execution every iteration of maintain() before this could even start to become an issue and likely the calculation of isBuildBlocked(p) will become a bottleneck before updateSnapshot() will. Additionally since the snapshot itself only ever has at most one reference originating outside of the stack it should remain in the eden space and thus be cheap to GC.\r\n\r\n- JENKINS-27708 comments 225819 and 225906 provide more complex but logically equivalent fixes of  this issue. I am favouring this approach as it is simpler and provides less scope for error as any new helper methods can just rely on the snapshot being up to date whereas with the other two candidates if a new helper method is introduced there is the potential to miss adding support for the live view. The comment 225819 has the risk of introducing extra lock contention while the comment 225906 version forces every access to the helper methods to pass a second memory barrier\r\n\r\n@reviewbybees","created_at":"2015-04-13T08:50:01Z","updated_at":"2015-04-15T15:29:24Z","closed_at":"2015-04-15T15:27:47Z","merged_at":"2015-04-15T15:27:47Z","merge_commit_sha":"16ef4d5000267a435d357945c8f345ffa5f7b787","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1645/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1645/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/1645/comments","statuses_url":"https://api.github.com/repos/jenkinsci/jenkins/statuses/57efbea3d0326f8b24bbe458fa1d25f6f45589f8","head":{"label":"stephenc:jenkins-27708","ref":"jenkins-27708","sha":"57efbea3d0326f8b24bbe458fa1d25f6f45589f8","user":{"login":"stephenc","id":209336,"avatar_url":"https://avatars.githubusercontent.com/u/209336?v=3","gravatar_id":"","url":"https://api.github.com/users/stephenc","html_url":"https://github.com/stephenc","followers_url":"https://api.github.com/users/stephenc/followers","following_url":"https://api.github.com/users/stephenc/following{/other_user}","gists_url":"https://api.github.com/users/stephenc/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenc/subscriptions","organizations_url":"https://api.github.com/users/stephenc/orgs","repos_url":"https://api.github.com/users/stephenc/repos","events_url":"https://api.github.com/users/stephenc/events{/privacy}","received_events_url":"https://api.github.com/users/stephenc/received_events","type":"User","site_admin":false},"repo":{"id":1399992,"name":"jenkins","full_name":"stephenc/jenkins","owner":{"login":"stephenc","id":209336,"avatar_url":"https://avatars.githubusercontent.com/u/209336?v=3","gravatar_id":"","url":"https://api.github.com/users/stephenc","html_url":"https://github.com/stephenc","followers_url":"https://api.github.com/users/stephenc/followers","following_url":"https://api.github.com/users/stephenc/following{/other_user}","gists_url":"https://api.github.com/users/stephenc/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenc/subscriptions","organizations_url":"https://api.github.com/users/stephenc/orgs","repos_url":"https://api.github.com/users/stephenc/repos","events_url":"https://api.github.com/users/stephenc/events{/privacy}","received_events_url":"https://api.github.com/users/stephenc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stephenc/jenkins","description":"Jenkins Continuous Integration Server","fork":true,"url":"https://api.github.com/repos/stephenc/jenkins","forks_url":"https://api.github.com/repos/stephenc/jenkins/forks","keys_url":"https://api.github.com/repos/stephenc/jenkins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stephenc/jenkins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stephenc/jenkins/teams","hooks_url":"https://api.github.com/repos/stephenc/jenkins/hooks","issue_events_url":"https://api.github.com/repos/stephenc/jenkins/issues/events{/number}","events_url":"https://api.github.com/repos/stephenc/jenkins/events","assignees_url":"https://api.github.com/repos/stephenc/jenkins/assignees{/user}","branches_url":"https://api.github.com/repos/stephenc/jenkins/branches{/branch}","tags_url":"https://api.github.com/repos/stephenc/jenkins/tags","blobs_url":"https://api.github.com/repos/stephenc/jenkins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stephenc/jenkins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stephenc/jenkins/git/refs{/sha}","trees_url":"https://api.github.com/repos/stephenc/jenkins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stephenc/jenkins/statuses/{sha}","languages_url":"https://api.github.com/repos/stephenc/jenkins/languages","stargazers_url":"https://api.github.com/repos/stephenc/jenkins/stargazers","contributors_url":"https://api.github.com/repos/stephenc/jenkins/contributors","subscribers_url":"https://api.github.com/repos/stephenc/jenkins/subscribers","subscription_url":"https://api.github.com/repos/stephenc/jenkins/subscription","commits_url":"https://api.github.com/repos/stephenc/jenkins/commits{/sha}","git_commits_url":"https://api.github.com/repos/stephenc/jenkins/git/commits{/sha}","comments_url":"https://api.github.com/repos/stephenc/jenkins/comments{/number}","issue_comment_url":"https://api.github.com/repos/stephenc/jenkins/issues/comments{/number}","contents_url":"https://api.github.com/repos/stephenc/jenkins/contents/{+path}","compare_url":"https://api.github.com/repos/stephenc/jenkins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stephenc/jenkins/merges","archive_url":"https://api.github.com/repos/stephenc/jenkins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stephenc/jenkins/downloads","issues_url":"https://api.github.com/repos/stephenc/jenkins/issues{/number}","pulls_url":"https://api.github.com/repos/stephenc/jenkins/pulls{/number}","milestones_url":"https://api.github.com/repos/stephenc/jenkins/milestones{/number}","notifications_url":"https://api.github.com/repos/stephenc/jenkins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stephenc/jenkins/labels{/name}","releases_url":"https://api.github.com/repos/stephenc/jenkins/releases{/id}","created_at":"2011-02-22T23:22:48Z","updated_at":"2015-04-10T09:03:24Z","pushed_at":"2015-04-14T14:16:07Z","git_url":"git://github.com/stephenc/jenkins.git","ssh_url":"git@github.com:stephenc/jenkins.git","clone_url":"https://github.com/stephenc/jenkins.git","svn_url":"https://github.com/stephenc/jenkins","homepage":"http://jenkins-ci.org/","size":82743,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"jenkinsci:master","ref":"master","sha":"64465feb3ddae82d0180b398639004ff47892c82","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}","created_at":"2010-11-22T21:21:23Z","updated_at":"2015-04-15T15:27:48Z","pushed_at":"2015-04-15T15:27:47Z","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":"http://jenkins-ci.org/","size":406252,"stargazers_count":3948,"watchers_count":3948,"language":"Java","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1771,"mirror_url":null,"open_issues_count":105,"forks":1771,"open_issues":105,"watchers":3948,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1645"},"html":{"href":"https://github.com/jenkinsci/jenkins/pull/1645"},"issue":{"href":"https://api.github.com/repos/jenkinsci/jenkins/issues/1645"},"comments":{"href":"https://api.github.com/repos/jenkinsci/jenkins/issues/1645/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1645/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1645/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/jenkins/statuses/57efbea3d0326f8b24bbe458fa1d25f6f45589f8"}}}}