{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/220757070","pull_request_review_id":159239938,"id":220757070,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMDc1NzA3MA==","diff_hunk":"@@ -394,6 +394,11 @@ func (sched *Scheduler) bind(assumed *v1.Pod, b *v1.Binding) error {\n // scheduleOne does the entire scheduling workflow for a single pod.  It is serialized on the scheduling algorithm's host fitting.\n func (sched *Scheduler) scheduleOne() {\n \tpod := sched.config.NextPod()\n+\t// pod could be nil when schedulerQueue is closed\n+\t// add nil check to avoid triggering crash handling logic","path":"pkg/scheduler/scheduler.go","position":5,"original_position":5,"commit_id":"474b75c185313ffeb110f420e26cbb394b6f5d7f","original_commit_id":"474b75c185313ffeb110f420e26cbb394b6f5d7f","user":{"login":"bsalamat","id":14308438,"node_id":"MDQ6VXNlcjE0MzA4NDM4","avatar_url":"https://avatars3.githubusercontent.com/u/14308438?v=4","gravatar_id":"","url":"https://api.github.com/users/bsalamat","html_url":"https://github.com/bsalamat","followers_url":"https://api.github.com/users/bsalamat/followers","following_url":"https://api.github.com/users/bsalamat/following{/other_user}","gists_url":"https://api.github.com/users/bsalamat/gists{/gist_id}","starred_url":"https://api.github.com/users/bsalamat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsalamat/subscriptions","organizations_url":"https://api.github.com/users/bsalamat/orgs","repos_url":"https://api.github.com/users/bsalamat/repos","events_url":"https://api.github.com/users/bsalamat/events{/privacy}","received_events_url":"https://api.github.com/users/bsalamat/received_events","type":"User","site_admin":false},"body":"+1","created_at":"2018-09-26T23:47:03Z","updated_at":"2018-09-26T23:47:33Z","html_url":"https://github.com/kubernetes/kubernetes/pull/68700#discussion_r220757070","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/68700","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/220757070"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/68700#discussion_r220757070"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/68700"}},"in_reply_to_id":220326701},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/68700","id":215737153,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1NzM3MTUz","html_url":"https://github.com/kubernetes/kubernetes/pull/68700","diff_url":"https://github.com/kubernetes/kubernetes/pull/68700.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/68700.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/68700","number":68700,"state":"open","locked":false,"title":"shutdown schedulingQueue gracefully","user":{"login":"Huang-Wei","id":1425903,"node_id":"MDQ6VXNlcjE0MjU5MDM=","avatar_url":"https://avatars0.githubusercontent.com/u/1425903?v=4","gravatar_id":"","url":"https://api.github.com/users/Huang-Wei","html_url":"https://github.com/Huang-Wei","followers_url":"https://api.github.com/users/Huang-Wei/followers","following_url":"https://api.github.com/users/Huang-Wei/following{/other_user}","gists_url":"https://api.github.com/users/Huang-Wei/gists{/gist_id}","starred_url":"https://api.github.com/users/Huang-Wei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Huang-Wei/subscriptions","organizations_url":"https://api.github.com/users/Huang-Wei/orgs","repos_url":"https://api.github.com/users/Huang-Wei/repos","events_url":"https://api.github.com/users/Huang-Wei/events{/privacy}","received_events_url":"https://api.github.com/users/Huang-Wei/received_events","type":"User","site_admin":false},"body":"**What this PR does / why we need it**:\r\n\r\nWhen schedulingQueue is empty, scheduler is blocked to wait for new items (through `cond.Wait()`). At this time if stopCh() is closed(), actually the main scheduling goroutine has no chance to gracefully exit - it's still hanging there at step `cond.Wait()`.\r\n\r\nIt's not actually a bug, but it's good to add a fix to let scheduling goroutine exit gracefully in this case.\r\n\r\n**Which issue(s) this PR fixes**:\r\nFixes #68453\r\n\r\n**Special notes for your reviewer**:\r\n\r\n- I'm only aware of FIFO and PriorityQueue implements schedulingQueue. If there are others, please let me know\r\n- External scheduler implementation might be impacted  as a new `Close()` method is introduced in interface `SchedulingQueue`.\r\n\r\n**Release note**:\r\n```release-note\r\nNONE\r\n```\r\n\r\n/kind cleanup\r\n/sig scheduling\r\n/assign @k82cn \r\n","created_at":"2018-09-15T00:10:46Z","updated_at":"2018-09-26T23:47:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c062d4c662a76a9be9f7f67f1b10804ff1c7aa47","assignee":{"login":"k82cn","id":18107181,"node_id":"MDQ6VXNlcjE4MTA3MTgx","avatar_url":"https://avatars0.githubusercontent.com/u/18107181?v=4","gravatar_id":"","url":"https://api.github.com/users/k82cn","html_url":"https://github.com/k82cn","followers_url":"https://api.github.com/users/k82cn/followers","following_url":"https://api.github.com/users/k82cn/following{/other_user}","gists_url":"https://api.github.com/users/k82cn/gists{/gist_id}","starred_url":"https://api.github.com/users/k82cn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k82cn/subscriptions","organizations_url":"https://api.github.com/users/k82cn/orgs","repos_url":"https://api.github.com/users/k82cn/repos","events_url":"https://api.github.com/users/k82cn/events{/privacy}","received_events_url":"https://api.github.com/users/k82cn/received_events","type":"User","site_admin":false},"assignees":[{"login":"k82cn","id":18107181,"node_id":"MDQ6VXNlcjE4MTA3MTgx","avatar_url":"https://avatars0.githubusercontent.com/u/18107181?v=4","gravatar_id":"","url":"https://api.github.com/users/k82cn","html_url":"https://github.com/k82cn","followers_url":"https://api.github.com/users/k82cn/followers","following_url":"https://api.github.com/users/k82cn/following{/other_user}","gists_url":"https://api.github.com/users/k82cn/gists{/gist_id}","starred_url":"https://api.github.com/users/k82cn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k82cn/subscriptions","organizations_url":"https://api.github.com/users/k82cn/orgs","repos_url":"https://api.github.com/users/k82cn/repos","events_url":"https://api.github.com/users/k82cn/events{/privacy}","received_events_url":"https://api.github.com/users/k82cn/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":477397086,"node_id":"MDU6TGFiZWw0NzczOTcwODY=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/cncf-cla:%20yes","name":"cncf-cla: yes","color":"bfe5bf","default":false},{"id":122775691,"node_id":"MDU6TGFiZWwxMjI3NzU2OTE=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/kind/cleanup","name":"kind/cleanup","color":"c7def8","default":false},{"id":349530249,"node_id":"MDU6TGFiZWwzNDk1MzAyNDk=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/release-note-none","name":"release-note-none","color":"c2e0c6","default":false},{"id":125550211,"node_id":"MDU6TGFiZWwxMjU1NTAyMTE=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/scheduling","name":"sig/scheduling","color":"d2b48c","default":false},{"id":253450934,"node_id":"MDU6TGFiZWwyNTM0NTA5MzQ=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/M","name":"size/M","color":"eebb00","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/68700/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/68700/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/68700/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/474b75c185313ffeb110f420e26cbb394b6f5d7f","head":{"label":"Huang-Wei:schedulingQ-graceful-shutdown","ref":"schedulingQ-graceful-shutdown","sha":"474b75c185313ffeb110f420e26cbb394b6f5d7f","user":{"login":"Huang-Wei","id":1425903,"node_id":"MDQ6VXNlcjE0MjU5MDM=","avatar_url":"https://avatars0.githubusercontent.com/u/1425903?v=4","gravatar_id":"","url":"https://api.github.com/users/Huang-Wei","html_url":"https://github.com/Huang-Wei","followers_url":"https://api.github.com/users/Huang-Wei/followers","following_url":"https://api.github.com/users/Huang-Wei/following{/other_user}","gists_url":"https://api.github.com/users/Huang-Wei/gists{/gist_id}","starred_url":"https://api.github.com/users/Huang-Wei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Huang-Wei/subscriptions","organizations_url":"https://api.github.com/users/Huang-Wei/orgs","repos_url":"https://api.github.com/users/Huang-Wei/repos","events_url":"https://api.github.com/users/Huang-Wei/events{/privacy}","received_events_url":"https://api.github.com/users/Huang-Wei/received_events","type":"User","site_admin":false},"repo":{"id":140890403,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA4OTA0MDM=","name":"kubernetes","full_name":"Huang-Wei/kubernetes","private":false,"owner":{"login":"Huang-Wei","id":1425903,"node_id":"MDQ6VXNlcjE0MjU5MDM=","avatar_url":"https://avatars0.githubusercontent.com/u/1425903?v=4","gravatar_id":"","url":"https://api.github.com/users/Huang-Wei","html_url":"https://github.com/Huang-Wei","followers_url":"https://api.github.com/users/Huang-Wei/followers","following_url":"https://api.github.com/users/Huang-Wei/following{/other_user}","gists_url":"https://api.github.com/users/Huang-Wei/gists{/gist_id}","starred_url":"https://api.github.com/users/Huang-Wei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Huang-Wei/subscriptions","organizations_url":"https://api.github.com/users/Huang-Wei/orgs","repos_url":"https://api.github.com/users/Huang-Wei/repos","events_url":"https://api.github.com/users/Huang-Wei/events{/privacy}","received_events_url":"https://api.github.com/users/Huang-Wei/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Huang-Wei/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":true,"url":"https://api.github.com/repos/Huang-Wei/kubernetes","forks_url":"https://api.github.com/repos/Huang-Wei/kubernetes/forks","keys_url":"https://api.github.com/repos/Huang-Wei/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Huang-Wei/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Huang-Wei/kubernetes/teams","hooks_url":"https://api.github.com/repos/Huang-Wei/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/Huang-Wei/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/Huang-Wei/kubernetes/events","assignees_url":"https://api.github.com/repos/Huang-Wei/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/Huang-Wei/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/Huang-Wei/kubernetes/tags","blobs_url":"https://api.github.com/repos/Huang-Wei/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Huang-Wei/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Huang-Wei/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/Huang-Wei/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Huang-Wei/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/Huang-Wei/kubernetes/languages","stargazers_url":"https://api.github.com/repos/Huang-Wei/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/Huang-Wei/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/Huang-Wei/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/Huang-Wei/kubernetes/subscription","commits_url":"https://api.github.com/repos/Huang-Wei/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/Huang-Wei/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/Huang-Wei/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/Huang-Wei/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/Huang-Wei/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/Huang-Wei/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Huang-Wei/kubernetes/merges","archive_url":"https://api.github.com/repos/Huang-Wei/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Huang-Wei/kubernetes/downloads","issues_url":"https://api.github.com/repos/Huang-Wei/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/Huang-Wei/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/Huang-Wei/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/Huang-Wei/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Huang-Wei/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/Huang-Wei/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/Huang-Wei/kubernetes/deployments","created_at":"2018-07-13T20:30:19Z","updated_at":"2018-09-22T06:49:48Z","pushed_at":"2018-09-25T00:24:18Z","git_url":"git://github.com/Huang-Wei/kubernetes.git","ssh_url":"git@github.com:Huang-Wei/kubernetes.git","clone_url":"https://github.com/Huang-Wei/kubernetes.git","svn_url":"https://github.com/Huang-Wei/kubernetes","homepage":"http://kubernetes.io","size":590294,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"f193e4b107de1c208d127bd1b9ff28a88a34b1cf","user":{"login":"kubernetes","id":13629408,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNjI5NDA4","avatar_url":"https://avatars2.githubusercontent.com/u/13629408?v=4","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"node_id":"MDEwOlJlcG9zaXRvcnkyMDU4MDQ5OA==","name":"kubernetes","full_name":"kubernetes/kubernetes","private":false,"owner":{"login":"kubernetes","id":13629408,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNjI5NDA4","avatar_url":"https://avatars2.githubusercontent.com/u/13629408?v=4","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/kubernetes/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/kubernetes/deployments","created_at":"2014-06-06T22:56:04Z","updated_at":"2018-09-26T23:21:57Z","pushed_at":"2018-09-26T22:53:38Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":810628,"stargazers_count":41865,"watchers_count":41865,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":14534,"mirror_url":null,"archived":false,"open_issues_count":3213,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":14534,"open_issues":3213,"watchers":41865,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/68700"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/68700"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/68700"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/68700/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/68700/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/68700/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/474b75c185313ffeb110f420e26cbb394b6f5d7f"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"bsalamat"}}