{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/87838535","pull_request_review_id":8433464,"id":87838535,"diff_hunk":"@@ -377,15 +377,18 @@ func (l *SSHTunnelList) healthCheck(e sshTunnelEntry) error {\n func (l *SSHTunnelList) removeAndReAdd(e sshTunnelEntry) {\n \t// Find the entry to replace.\n \tl.tunnelsLock.Lock()\n-\tdefer l.tunnelsLock.Unlock()\n \tfor i, entry := range l.entries {\n \t\tif entry.Tunnel == e.Tunnel {\n \t\t\tl.entries = append(l.entries[:i], l.entries[i+1:]...)\n \t\t\tl.adding[e.Address] = true\n-\t\t\tgo l.createAndAddTunnel(e.Address)\n-\t\t\treturn\n+\t\t\tbreak\n \t\t}\n \t}\n+\tl.tunnelsLock.Unlock()\n+\tif err := e.Tunnel.Close(); err != nil {","path":"pkg/ssh/ssh.go","position":15,"original_position":15,"commit_id":"1fdb3ee902082008f2d198783965bbf43b7070d0","original_commit_id":"1fdb3ee902082008f2d198783965bbf43b7070d0","user":{"login":"yujuhong","id":10524058,"avatar_url":"https://avatars.githubusercontent.com/u/10524058?v=3","gravatar_id":"","url":"https://api.github.com/users/yujuhong","html_url":"https://github.com/yujuhong","followers_url":"https://api.github.com/users/yujuhong/followers","following_url":"https://api.github.com/users/yujuhong/following{/other_user}","gists_url":"https://api.github.com/users/yujuhong/gists{/gist_id}","starred_url":"https://api.github.com/users/yujuhong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yujuhong/subscriptions","organizations_url":"https://api.github.com/users/yujuhong/orgs","repos_url":"https://api.github.com/users/yujuhong/repos","events_url":"https://api.github.com/users/yujuhong/events{/privacy}","received_events_url":"https://api.github.com/users/yujuhong/received_events","type":"User","site_admin":false},"body":"Hmm...do you need to handle the \"not found\" case, or is it safe to call `Close()` anyway?","created_at":"2016-11-14T16:36:21Z","updated_at":"2016-11-14T16:36:21Z","html_url":"https://github.com/kubernetes/kubernetes/pull/36549#discussion_r87838535","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/36549","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/87838535"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/36549#discussion_r87838535"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/36549"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/36549","id":93067275,"html_url":"https://github.com/kubernetes/kubernetes/pull/36549","diff_url":"https://github.com/kubernetes/kubernetes/pull/36549.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/36549.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/36549","number":36549,"state":"open","locked":false,"title":"Close tunnels after failed healthchecks.","user":{"login":"cjcullen","id":7154008,"avatar_url":"https://avatars.githubusercontent.com/u/7154008?v=3","gravatar_id":"","url":"https://api.github.com/users/cjcullen","html_url":"https://github.com/cjcullen","followers_url":"https://api.github.com/users/cjcullen/followers","following_url":"https://api.github.com/users/cjcullen/following{/other_user}","gists_url":"https://api.github.com/users/cjcullen/gists{/gist_id}","starred_url":"https://api.github.com/users/cjcullen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjcullen/subscriptions","organizations_url":"https://api.github.com/users/cjcullen/orgs","repos_url":"https://api.github.com/users/cjcullen/repos","events_url":"https://api.github.com/users/cjcullen/events{/privacy}","received_events_url":"https://api.github.com/users/cjcullen/received_events","type":"User","site_admin":false},"body":"When we fail an ssh-tunnel healthcheck, we currently leak a file descriptor keeping the SSH connection open.\r\n\r\nThis closes the underlying tunnel before removing our pointer to it. It is possible that the tunnel was functional, but the healthcheck failed for some other reason (e.g. kubelet healthz down), which could close an in-use tunnel, but I think that is acceptable.\n\n<!-- Reviewable:start -->\n\n---\nThis change is [<img src=\"https://reviewable.kubernetes.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/36549)\n<!-- Reviewable:end -->\n","created_at":"2016-11-10T00:48:59Z","updated_at":"2016-11-14T16:36:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"979aabfe269ea542de0167378af87c163ffc4761","assignee":{"login":"thockin","id":5595220,"avatar_url":"https://avatars.githubusercontent.com/u/5595220?v=3","gravatar_id":"","url":"https://api.github.com/users/thockin","html_url":"https://github.com/thockin","followers_url":"https://api.github.com/users/thockin/followers","following_url":"https://api.github.com/users/thockin/following{/other_user}","gists_url":"https://api.github.com/users/thockin/gists{/gist_id}","starred_url":"https://api.github.com/users/thockin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thockin/subscriptions","organizations_url":"https://api.github.com/users/thockin/orgs","repos_url":"https://api.github.com/users/thockin/repos","events_url":"https://api.github.com/users/thockin/events{/privacy}","received_events_url":"https://api.github.com/users/thockin/received_events","type":"User","site_admin":false},"assignees":[{"login":"thockin","id":5595220,"avatar_url":"https://avatars.githubusercontent.com/u/5595220?v=3","gravatar_id":"","url":"https://api.github.com/users/thockin","html_url":"https://github.com/thockin","followers_url":"https://api.github.com/users/thockin/followers","following_url":"https://api.github.com/users/thockin/following{/other_user}","gists_url":"https://api.github.com/users/thockin/gists{/gist_id}","starred_url":"https://api.github.com/users/thockin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thockin/subscriptions","organizations_url":"https://api.github.com/users/thockin/orgs","repos_url":"https://api.github.com/users/thockin/repos","events_url":"https://api.github.com/users/thockin/events{/privacy}","received_events_url":"https://api.github.com/users/thockin/received_events","type":"User","site_admin":false},{"login":"yujuhong","id":10524058,"avatar_url":"https://avatars.githubusercontent.com/u/10524058?v=3","gravatar_id":"","url":"https://api.github.com/users/yujuhong","html_url":"https://github.com/yujuhong","followers_url":"https://api.github.com/users/yujuhong/followers","following_url":"https://api.github.com/users/yujuhong/following{/other_user}","gists_url":"https://api.github.com/users/yujuhong/gists{/gist_id}","starred_url":"https://api.github.com/users/yujuhong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yujuhong/subscriptions","organizations_url":"https://api.github.com/users/yujuhong/orgs","repos_url":"https://api.github.com/users/yujuhong/repos","events_url":"https://api.github.com/users/yujuhong/events{/privacy}","received_events_url":"https://api.github.com/users/yujuhong/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/kubernetes/kubernetes/milestones/23","html_url":"https://github.com/kubernetes/kubernetes/milestones/v1.5","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones/23/labels","id":1945978,"number":23,"title":"v1.5","description":"","creator":{"login":"lavalamp","id":647318,"avatar_url":"https://avatars.githubusercontent.com/u/647318?v=3","gravatar_id":"","url":"https://api.github.com/users/lavalamp","html_url":"https://github.com/lavalamp","followers_url":"https://api.github.com/users/lavalamp/followers","following_url":"https://api.github.com/users/lavalamp/following{/other_user}","gists_url":"https://api.github.com/users/lavalamp/gists{/gist_id}","starred_url":"https://api.github.com/users/lavalamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lavalamp/subscriptions","organizations_url":"https://api.github.com/users/lavalamp/orgs","repos_url":"https://api.github.com/users/lavalamp/repos","events_url":"https://api.github.com/users/lavalamp/events{/privacy}","received_events_url":"https://api.github.com/users/lavalamp/received_events","type":"User","site_admin":false},"open_issues":289,"closed_issues":585,"state":"open","created_at":"2016-08-16T21:47:28Z","updated_at":"2016-11-14T16:26:48Z","due_on":"2016-12-09T00:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/36549/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/36549/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/36549/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/1fdb3ee902082008f2d198783965bbf43b7070d0","head":{"label":"cjcullen:closetunnel","ref":"closetunnel","sha":"1fdb3ee902082008f2d198783965bbf43b7070d0","user":{"login":"cjcullen","id":7154008,"avatar_url":"https://avatars.githubusercontent.com/u/7154008?v=3","gravatar_id":"","url":"https://api.github.com/users/cjcullen","html_url":"https://github.com/cjcullen","followers_url":"https://api.github.com/users/cjcullen/followers","following_url":"https://api.github.com/users/cjcullen/following{/other_user}","gists_url":"https://api.github.com/users/cjcullen/gists{/gist_id}","starred_url":"https://api.github.com/users/cjcullen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjcullen/subscriptions","organizations_url":"https://api.github.com/users/cjcullen/orgs","repos_url":"https://api.github.com/users/cjcullen/repos","events_url":"https://api.github.com/users/cjcullen/events{/privacy}","received_events_url":"https://api.github.com/users/cjcullen/received_events","type":"User","site_admin":false},"repo":{"id":22969428,"name":"kubernetes","full_name":"cjcullen/kubernetes","owner":{"login":"cjcullen","id":7154008,"avatar_url":"https://avatars.githubusercontent.com/u/7154008?v=3","gravatar_id":"","url":"https://api.github.com/users/cjcullen","html_url":"https://github.com/cjcullen","followers_url":"https://api.github.com/users/cjcullen/followers","following_url":"https://api.github.com/users/cjcullen/following{/other_user}","gists_url":"https://api.github.com/users/cjcullen/gists{/gist_id}","starred_url":"https://api.github.com/users/cjcullen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjcullen/subscriptions","organizations_url":"https://api.github.com/users/cjcullen/orgs","repos_url":"https://api.github.com/users/cjcullen/repos","events_url":"https://api.github.com/users/cjcullen/events{/privacy}","received_events_url":"https://api.github.com/users/cjcullen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cjcullen/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/cjcullen/kubernetes","forks_url":"https://api.github.com/repos/cjcullen/kubernetes/forks","keys_url":"https://api.github.com/repos/cjcullen/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cjcullen/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cjcullen/kubernetes/teams","hooks_url":"https://api.github.com/repos/cjcullen/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/cjcullen/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/cjcullen/kubernetes/events","assignees_url":"https://api.github.com/repos/cjcullen/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/cjcullen/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/cjcullen/kubernetes/tags","blobs_url":"https://api.github.com/repos/cjcullen/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cjcullen/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cjcullen/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/cjcullen/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cjcullen/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/cjcullen/kubernetes/languages","stargazers_url":"https://api.github.com/repos/cjcullen/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/cjcullen/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/cjcullen/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/cjcullen/kubernetes/subscription","commits_url":"https://api.github.com/repos/cjcullen/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/cjcullen/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/cjcullen/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/cjcullen/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/cjcullen/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/cjcullen/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cjcullen/kubernetes/merges","archive_url":"https://api.github.com/repos/cjcullen/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cjcullen/kubernetes/downloads","issues_url":"https://api.github.com/repos/cjcullen/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/cjcullen/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/cjcullen/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/cjcullen/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cjcullen/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/cjcullen/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/cjcullen/kubernetes/deployments","created_at":"2014-08-14T21:36:31Z","updated_at":"2016-01-15T19:52:38Z","pushed_at":"2016-11-11T23:14:55Z","git_url":"git://github.com/cjcullen/kubernetes.git","ssh_url":"git@github.com:cjcullen/kubernetes.git","clone_url":"https://github.com/cjcullen/kubernetes.git","svn_url":"https://github.com/cjcullen/kubernetes","homepage":null,"size":342673,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"kubernetes:master","ref":"master","sha":"0f774de8ff07f0d3e144ccef6354857cfba86b09","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","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,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","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},"private":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":"2016-11-14T16:11:56Z","pushed_at":"2016-11-14T16:33:17Z","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":629782,"stargazers_count":18388,"watchers_count":18388,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6047,"mirror_url":null,"open_issues_count":5289,"forks":6047,"open_issues":5289,"watchers":18388,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/36549"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/36549"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/36549"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/36549/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/36549/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/36549/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/1fdb3ee902082008f2d198783965bbf43b7070d0"}}}}
{"actor":{"display_login":"yujuhong"}}