{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/77832649","id":77832649,"diff_hunk":"@@ -122,47 +131,77 @@ func (*NativeExecHandler) ExecInContainer(client DockerInterface, container *doc\n \t\treturn fmt.Errorf(\"failed to exec in container - Exec setup failed - %v\", err)\n \t}\n \n-\t// Have to start this before the call to client.StartExec because client.StartExec is a blocking\n-\t// call :-( Otherwise, resize events don't get processed and the terminal never resizes.\n-\tkubecontainer.HandleResizing(resize, func(size term.Size) {\n-\t\tclient.ResizeExecTTY(execObj.ID, int(size.Height), int(size.Width))\n-\t})\n-\n-\tstartOpts := dockertypes.ExecStartCheck{Detach: false, Tty: tty}\n-\tstreamOpts := StreamOptions{\n-\t\tInputStream:  stdin,\n-\t\tOutputStream: stdout,\n-\t\tErrorStream:  stderr,\n-\t\tRawTerminal:  tty,\n-\t}\n-\terr = client.StartExec(execObj.ID, startOpts, streamOpts)\n-\tif err != nil {\n-\t\treturn err\n-\t}\n+\tch := make(chan error, 1)\n+\t// Run client.StartExec in a new goroutine, because it is blocking and\n+\t// we may want to terminate earlier in case of a timeout.\n+\tgo func() {","path":"pkg/kubelet/dockertools/exec.go","position":84,"original_position":84,"commit_id":"d22f72835074b26f7860d60d3cb9eea150283a9a","original_commit_id":"d22f72835074b26f7860d60d3cb9eea150283a9a","user":{"login":"sttts","id":730123,"avatar_url":"https://avatars.githubusercontent.com/u/730123?v=3","gravatar_id":"","url":"https://api.github.com/users/sttts","html_url":"https://github.com/sttts","followers_url":"https://api.github.com/users/sttts/followers","following_url":"https://api.github.com/users/sttts/following{/other_user}","gists_url":"https://api.github.com/users/sttts/gists{/gist_id}","starred_url":"https://api.github.com/users/sttts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sttts/subscriptions","organizations_url":"https://api.github.com/users/sttts/orgs","repos_url":"https://api.github.com/users/sttts/repos","events_url":"https://api.github.com/users/sttts/events{/privacy}","received_events_url":"https://api.github.com/users/sttts/received_events","type":"User","site_admin":false},"body":"a bit ugly to have the `ch` in every code path. Just an idea:\r\n\r\n```go\r\nexec := func () { ... } error\r\ngo func () {\r\n  ch <-exec()\r\n}()\r\n```","created_at":"2016-09-07T14:28:02Z","updated_at":"2016-09-07T14:28:02Z","html_url":"https://github.com/kubernetes/kubernetes/pull/27956#discussion_r77832649","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/27956","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/77832649"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/27956#discussion_r77832649"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/27956"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/27956","id":75000995,"html_url":"https://github.com/kubernetes/kubernetes/pull/27956","diff_url":"https://github.com/kubernetes/kubernetes/pull/27956.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/27956.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/27956","number":27956,"state":"open","locked":false,"title":"Make Exec probes respect timeout","user":{"login":"rhcarvalho","id":88819,"avatar_url":"https://avatars.githubusercontent.com/u/88819?v=3","gravatar_id":"","url":"https://api.github.com/users/rhcarvalho","html_url":"https://github.com/rhcarvalho","followers_url":"https://api.github.com/users/rhcarvalho/followers","following_url":"https://api.github.com/users/rhcarvalho/following{/other_user}","gists_url":"https://api.github.com/users/rhcarvalho/gists{/gist_id}","starred_url":"https://api.github.com/users/rhcarvalho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhcarvalho/subscriptions","organizations_url":"https://api.github.com/users/rhcarvalho/orgs","repos_url":"https://api.github.com/users/rhcarvalho/repos","events_url":"https://api.github.com/users/rhcarvalho/events{/privacy}","received_events_url":"https://api.github.com/users/rhcarvalho/received_events","type":"User","site_admin":false},"body":"Fixes #26895.\r\n\r\nAs described in the issue, `Exec` probes used to disregard the timeout setting observed by `HTTPGet` and `TCPSocket` probes.\r\n\r\n@dims opened #26899 to tackle it, but I think I could contribute with something more than just comments. @dims please if you see value in the changes here feel free to absorb it in your PR.\r\n\r\nThis is a bigger change than @dims's PR because we need to change interfaces to pass the timeout to the code that actually runs the command, so that the process can be killed after the timeout.\r\n\r\nIncludes an e2e test.\r\n\r\n<!-- Reviewable:start -->\r\n---\r\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/27956)\r\n<!-- Reviewable:end -->\r\n","created_at":"2016-06-23T18:11:55Z","updated_at":"2016-09-07T14:28:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c83aea8016c139e8682a75e28ec4d26ed3fa1070","assignee":{"login":"ncdc","id":354,"avatar_url":"https://avatars.githubusercontent.com/u/354?v=3","gravatar_id":"","url":"https://api.github.com/users/ncdc","html_url":"https://github.com/ncdc","followers_url":"https://api.github.com/users/ncdc/followers","following_url":"https://api.github.com/users/ncdc/following{/other_user}","gists_url":"https://api.github.com/users/ncdc/gists{/gist_id}","starred_url":"https://api.github.com/users/ncdc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncdc/subscriptions","organizations_url":"https://api.github.com/users/ncdc/orgs","repos_url":"https://api.github.com/users/ncdc/repos","events_url":"https://api.github.com/users/ncdc/events{/privacy}","received_events_url":"https://api.github.com/users/ncdc/received_events","type":"User","site_admin":false},"assignees":[{"login":"ncdc","id":354,"avatar_url":"https://avatars.githubusercontent.com/u/354?v=3","gravatar_id":"","url":"https://api.github.com/users/ncdc","html_url":"https://github.com/ncdc","followers_url":"https://api.github.com/users/ncdc/followers","following_url":"https://api.github.com/users/ncdc/following{/other_user}","gists_url":"https://api.github.com/users/ncdc/gists{/gist_id}","starred_url":"https://api.github.com/users/ncdc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncdc/subscriptions","organizations_url":"https://api.github.com/users/ncdc/orgs","repos_url":"https://api.github.com/users/ncdc/repos","events_url":"https://api.github.com/users/ncdc/events{/privacy}","received_events_url":"https://api.github.com/users/ncdc/received_events","type":"User","site_admin":false},{"login":"vishh","id":7063592,"avatar_url":"https://avatars.githubusercontent.com/u/7063592?v=3","gravatar_id":"","url":"https://api.github.com/users/vishh","html_url":"https://github.com/vishh","followers_url":"https://api.github.com/users/vishh/followers","following_url":"https://api.github.com/users/vishh/following{/other_user}","gists_url":"https://api.github.com/users/vishh/gists{/gist_id}","starred_url":"https://api.github.com/users/vishh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vishh/subscriptions","organizations_url":"https://api.github.com/users/vishh/orgs","repos_url":"https://api.github.com/users/vishh/repos","events_url":"https://api.github.com/users/vishh/events{/privacy}","received_events_url":"https://api.github.com/users/vishh/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/27956/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/27956/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/27956/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/d22f72835074b26f7860d60d3cb9eea150283a9a","head":{"label":"rhcarvalho:execincontainer-timeout","ref":"execincontainer-timeout","sha":"d22f72835074b26f7860d60d3cb9eea150283a9a","user":{"login":"rhcarvalho","id":88819,"avatar_url":"https://avatars.githubusercontent.com/u/88819?v=3","gravatar_id":"","url":"https://api.github.com/users/rhcarvalho","html_url":"https://github.com/rhcarvalho","followers_url":"https://api.github.com/users/rhcarvalho/followers","following_url":"https://api.github.com/users/rhcarvalho/following{/other_user}","gists_url":"https://api.github.com/users/rhcarvalho/gists{/gist_id}","starred_url":"https://api.github.com/users/rhcarvalho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhcarvalho/subscriptions","organizations_url":"https://api.github.com/users/rhcarvalho/orgs","repos_url":"https://api.github.com/users/rhcarvalho/repos","events_url":"https://api.github.com/users/rhcarvalho/events{/privacy}","received_events_url":"https://api.github.com/users/rhcarvalho/received_events","type":"User","site_admin":false},"repo":{"id":35096604,"name":"kubernetes","full_name":"rhcarvalho/kubernetes","owner":{"login":"rhcarvalho","id":88819,"avatar_url":"https://avatars.githubusercontent.com/u/88819?v=3","gravatar_id":"","url":"https://api.github.com/users/rhcarvalho","html_url":"https://github.com/rhcarvalho","followers_url":"https://api.github.com/users/rhcarvalho/followers","following_url":"https://api.github.com/users/rhcarvalho/following{/other_user}","gists_url":"https://api.github.com/users/rhcarvalho/gists{/gist_id}","starred_url":"https://api.github.com/users/rhcarvalho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhcarvalho/subscriptions","organizations_url":"https://api.github.com/users/rhcarvalho/orgs","repos_url":"https://api.github.com/users/rhcarvalho/repos","events_url":"https://api.github.com/users/rhcarvalho/events{/privacy}","received_events_url":"https://api.github.com/users/rhcarvalho/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rhcarvalho/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/rhcarvalho/kubernetes","forks_url":"https://api.github.com/repos/rhcarvalho/kubernetes/forks","keys_url":"https://api.github.com/repos/rhcarvalho/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rhcarvalho/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rhcarvalho/kubernetes/teams","hooks_url":"https://api.github.com/repos/rhcarvalho/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/rhcarvalho/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/rhcarvalho/kubernetes/events","assignees_url":"https://api.github.com/repos/rhcarvalho/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/rhcarvalho/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/rhcarvalho/kubernetes/tags","blobs_url":"https://api.github.com/repos/rhcarvalho/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rhcarvalho/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rhcarvalho/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/rhcarvalho/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rhcarvalho/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/rhcarvalho/kubernetes/languages","stargazers_url":"https://api.github.com/repos/rhcarvalho/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/rhcarvalho/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/rhcarvalho/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/rhcarvalho/kubernetes/subscription","commits_url":"https://api.github.com/repos/rhcarvalho/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/rhcarvalho/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/rhcarvalho/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/rhcarvalho/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/rhcarvalho/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/rhcarvalho/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rhcarvalho/kubernetes/merges","archive_url":"https://api.github.com/repos/rhcarvalho/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rhcarvalho/kubernetes/downloads","issues_url":"https://api.github.com/repos/rhcarvalho/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/rhcarvalho/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/rhcarvalho/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/rhcarvalho/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rhcarvalho/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/rhcarvalho/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/rhcarvalho/kubernetes/deployments","created_at":"2015-05-05T12:00:41Z","updated_at":"2016-01-11T10:42:17Z","pushed_at":"2016-09-07T14:21:11Z","git_url":"git://github.com/rhcarvalho/kubernetes.git","ssh_url":"git@github.com:rhcarvalho/kubernetes.git","clone_url":"https://github.com/rhcarvalho/kubernetes.git","svn_url":"https://github.com/rhcarvalho/kubernetes","homepage":"http://kubernetes.io","size":310692,"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":"e976bc9ed2b6729142c9d4af2a04aa1a7cc773fa","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-09-07T14:19:28Z","pushed_at":"2016-09-07T14:27:08Z","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":557997,"stargazers_count":16576,"watchers_count":16576,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5348,"mirror_url":null,"open_issues_count":4420,"forks":5348,"open_issues":4420,"watchers":16576,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/27956"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/27956"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/27956"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/27956/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/27956/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/27956/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/d22f72835074b26f7860d60d3cb9eea150283a9a"}}}}
{"actor":{"display_login":"sttts"}}