{"action":"created","comment":{"url":"https://api.github.com/repos/kata-containers/proxy/pulls/comments/165302554","pull_request_review_id":93216979,"id":165302554,"diff_hunk":"@@ -177,6 +179,44 @@ func printAgentLogs(sock string) error {\n \treturn nil\n }\n \n+func setupSigtermNotifier() chan os.Signal {\n+\tsigCh := make(chan os.Signal)\n+\tsignal.Notify(sigCh, syscall.SIGTERM)\n+\n+\treturn sigCh\n+}\n+\n+func handleSigtermSignal(sigCh chan os.Signal, vmConn net.Conn, proxyListener net.Listener) error {\n+\tif sigCh == nil {\n+\t\treturn fmt.Errorf(\"Signal channel cannot be nil, it has to be initialized\")\n+\t}\n+\n+\t// Blocking here waiting for the signal to be received.\n+\tsig := <-sigCh\n+\tif sig != syscall.SIGTERM {","path":"proxy.go","position":57,"original_position":57,"commit_id":"ace09e49fa9efafc3b4b7c8d8f2fa7d7d7805e52","original_commit_id":"ace09e49fa9efafc3b4b7c8d8f2fa7d7d7805e52","user":{"login":"jodh-intel","id":20315601,"avatar_url":"https://avatars1.githubusercontent.com/u/20315601?v=4","gravatar_id":"","url":"https://api.github.com/users/jodh-intel","html_url":"https://github.com/jodh-intel","followers_url":"https://api.github.com/users/jodh-intel/followers","following_url":"https://api.github.com/users/jodh-intel/following{/other_user}","gists_url":"https://api.github.com/users/jodh-intel/gists{/gist_id}","starred_url":"https://api.github.com/users/jodh-intel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jodh-intel/subscriptions","organizations_url":"https://api.github.com/users/jodh-intel/orgs","repos_url":"https://api.github.com/users/jodh-intel/repos","events_url":"https://api.github.com/users/jodh-intel/events{/privacy}","received_events_url":"https://api.github.com/users/jodh-intel/received_events","type":"User","site_admin":false},"body":"`if sig != termSignal` maybe.","created_at":"2018-02-01T09:47:27Z","updated_at":"2018-02-01T09:49:04Z","html_url":"https://github.com/kata-containers/proxy/pull/46#discussion_r165302554","pull_request_url":"https://api.github.com/repos/kata-containers/proxy/pulls/46","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/kata-containers/proxy/pulls/comments/165302554"},"html":{"href":"https://github.com/kata-containers/proxy/pull/46#discussion_r165302554"},"pull_request":{"href":"https://api.github.com/repos/kata-containers/proxy/pulls/46"}}},"pull_request":{"url":"https://api.github.com/repos/kata-containers/proxy/pulls/46","id":166361767,"html_url":"https://github.com/kata-containers/proxy/pull/46","diff_url":"https://github.com/kata-containers/proxy/pull/46.diff","patch_url":"https://github.com/kata-containers/proxy/pull/46.patch","issue_url":"https://api.github.com/repos/kata-containers/proxy/issues/46","number":46,"state":"open","locked":false,"title":"proxy: Cleanup the proxy connections on SIGTERM","user":{"login":"sboeuf","id":22890413,"avatar_url":"https://avatars3.githubusercontent.com/u/22890413?v=4","gravatar_id":"","url":"https://api.github.com/users/sboeuf","html_url":"https://github.com/sboeuf","followers_url":"https://api.github.com/users/sboeuf/followers","following_url":"https://api.github.com/users/sboeuf/following{/other_user}","gists_url":"https://api.github.com/users/sboeuf/gists{/gist_id}","starred_url":"https://api.github.com/users/sboeuf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sboeuf/subscriptions","organizations_url":"https://api.github.com/users/sboeuf/orgs","repos_url":"https://api.github.com/users/sboeuf/repos","events_url":"https://api.github.com/users/sboeuf/events{/privacy}","received_events_url":"https://api.github.com/users/sboeuf/received_events","type":"User","site_admin":false},"body":"This patch forces the proxy to listen on SIGTERM signal and to trigger\r\nthe appropriate cleanup on the connections with shim/rutime on one\r\nside, and the VM/agent on the other side.\r\n\r\nFixes #36\r\n\r\nSigned-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>","created_at":"2018-01-31T20:02:41Z","updated_at":"2018-02-01T09:49:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3ec3e1f1408d5306eac598266d0d9240723da73f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/kata-containers/proxy/pulls/46/commits","review_comments_url":"https://api.github.com/repos/kata-containers/proxy/pulls/46/comments","review_comment_url":"https://api.github.com/repos/kata-containers/proxy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kata-containers/proxy/issues/46/comments","statuses_url":"https://api.github.com/repos/kata-containers/proxy/statuses/ace09e49fa9efafc3b4b7c8d8f2fa7d7d7805e52","head":{"label":"sboeuf:cleanup_on_sigterm","ref":"cleanup_on_sigterm","sha":"ace09e49fa9efafc3b4b7c8d8f2fa7d7d7805e52","user":{"login":"sboeuf","id":22890413,"avatar_url":"https://avatars3.githubusercontent.com/u/22890413?v=4","gravatar_id":"","url":"https://api.github.com/users/sboeuf","html_url":"https://github.com/sboeuf","followers_url":"https://api.github.com/users/sboeuf/followers","following_url":"https://api.github.com/users/sboeuf/following{/other_user}","gists_url":"https://api.github.com/users/sboeuf/gists{/gist_id}","starred_url":"https://api.github.com/users/sboeuf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sboeuf/subscriptions","organizations_url":"https://api.github.com/users/sboeuf/orgs","repos_url":"https://api.github.com/users/sboeuf/repos","events_url":"https://api.github.com/users/sboeuf/events{/privacy}","received_events_url":"https://api.github.com/users/sboeuf/received_events","type":"User","site_admin":false},"repo":{"id":117297203,"name":"proxy","full_name":"sboeuf/proxy","owner":{"login":"sboeuf","id":22890413,"avatar_url":"https://avatars3.githubusercontent.com/u/22890413?v=4","gravatar_id":"","url":"https://api.github.com/users/sboeuf","html_url":"https://github.com/sboeuf","followers_url":"https://api.github.com/users/sboeuf/followers","following_url":"https://api.github.com/users/sboeuf/following{/other_user}","gists_url":"https://api.github.com/users/sboeuf/gists{/gist_id}","starred_url":"https://api.github.com/users/sboeuf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sboeuf/subscriptions","organizations_url":"https://api.github.com/users/sboeuf/orgs","repos_url":"https://api.github.com/users/sboeuf/repos","events_url":"https://api.github.com/users/sboeuf/events{/privacy}","received_events_url":"https://api.github.com/users/sboeuf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sboeuf/proxy","description":"Kata Containers proxy","fork":true,"url":"https://api.github.com/repos/sboeuf/proxy","forks_url":"https://api.github.com/repos/sboeuf/proxy/forks","keys_url":"https://api.github.com/repos/sboeuf/proxy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sboeuf/proxy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sboeuf/proxy/teams","hooks_url":"https://api.github.com/repos/sboeuf/proxy/hooks","issue_events_url":"https://api.github.com/repos/sboeuf/proxy/issues/events{/number}","events_url":"https://api.github.com/repos/sboeuf/proxy/events","assignees_url":"https://api.github.com/repos/sboeuf/proxy/assignees{/user}","branches_url":"https://api.github.com/repos/sboeuf/proxy/branches{/branch}","tags_url":"https://api.github.com/repos/sboeuf/proxy/tags","blobs_url":"https://api.github.com/repos/sboeuf/proxy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sboeuf/proxy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sboeuf/proxy/git/refs{/sha}","trees_url":"https://api.github.com/repos/sboeuf/proxy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sboeuf/proxy/statuses/{sha}","languages_url":"https://api.github.com/repos/sboeuf/proxy/languages","stargazers_url":"https://api.github.com/repos/sboeuf/proxy/stargazers","contributors_url":"https://api.github.com/repos/sboeuf/proxy/contributors","subscribers_url":"https://api.github.com/repos/sboeuf/proxy/subscribers","subscription_url":"https://api.github.com/repos/sboeuf/proxy/subscription","commits_url":"https://api.github.com/repos/sboeuf/proxy/commits{/sha}","git_commits_url":"https://api.github.com/repos/sboeuf/proxy/git/commits{/sha}","comments_url":"https://api.github.com/repos/sboeuf/proxy/comments{/number}","issue_comment_url":"https://api.github.com/repos/sboeuf/proxy/issues/comments{/number}","contents_url":"https://api.github.com/repos/sboeuf/proxy/contents/{+path}","compare_url":"https://api.github.com/repos/sboeuf/proxy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sboeuf/proxy/merges","archive_url":"https://api.github.com/repos/sboeuf/proxy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sboeuf/proxy/downloads","issues_url":"https://api.github.com/repos/sboeuf/proxy/issues{/number}","pulls_url":"https://api.github.com/repos/sboeuf/proxy/pulls{/number}","milestones_url":"https://api.github.com/repos/sboeuf/proxy/milestones{/number}","notifications_url":"https://api.github.com/repos/sboeuf/proxy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sboeuf/proxy/labels{/name}","releases_url":"https://api.github.com/repos/sboeuf/proxy/releases{/id}","deployments_url":"https://api.github.com/repos/sboeuf/proxy/deployments","created_at":"2018-01-12T23:20:43Z","updated_at":"2018-01-12T23:20:45Z","pushed_at":"2018-01-31T20:05:45Z","git_url":"git://github.com/sboeuf/proxy.git","ssh_url":"git@github.com:sboeuf/proxy.git","clone_url":"https://github.com/sboeuf/proxy.git","svn_url":"https://github.com/sboeuf/proxy","homepage":null,"size":909,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kata-containers:master","ref":"master","sha":"8a92752c1338a42c043bd6bab496be01ae6140fd","user":{"login":"kata-containers","id":33289952,"avatar_url":"https://avatars3.githubusercontent.com/u/33289952?v=4","gravatar_id":"","url":"https://api.github.com/users/kata-containers","html_url":"https://github.com/kata-containers","followers_url":"https://api.github.com/users/kata-containers/followers","following_url":"https://api.github.com/users/kata-containers/following{/other_user}","gists_url":"https://api.github.com/users/kata-containers/gists{/gist_id}","starred_url":"https://api.github.com/users/kata-containers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kata-containers/subscriptions","organizations_url":"https://api.github.com/users/kata-containers/orgs","repos_url":"https://api.github.com/users/kata-containers/repos","events_url":"https://api.github.com/users/kata-containers/events{/privacy}","received_events_url":"https://api.github.com/users/kata-containers/received_events","type":"Organization","site_admin":false},"repo":{"id":110538587,"name":"proxy","full_name":"kata-containers/proxy","owner":{"login":"kata-containers","id":33289952,"avatar_url":"https://avatars3.githubusercontent.com/u/33289952?v=4","gravatar_id":"","url":"https://api.github.com/users/kata-containers","html_url":"https://github.com/kata-containers","followers_url":"https://api.github.com/users/kata-containers/followers","following_url":"https://api.github.com/users/kata-containers/following{/other_user}","gists_url":"https://api.github.com/users/kata-containers/gists{/gist_id}","starred_url":"https://api.github.com/users/kata-containers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kata-containers/subscriptions","organizations_url":"https://api.github.com/users/kata-containers/orgs","repos_url":"https://api.github.com/users/kata-containers/repos","events_url":"https://api.github.com/users/kata-containers/events{/privacy}","received_events_url":"https://api.github.com/users/kata-containers/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kata-containers/proxy","description":"Kata Containers proxy","fork":false,"url":"https://api.github.com/repos/kata-containers/proxy","forks_url":"https://api.github.com/repos/kata-containers/proxy/forks","keys_url":"https://api.github.com/repos/kata-containers/proxy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kata-containers/proxy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kata-containers/proxy/teams","hooks_url":"https://api.github.com/repos/kata-containers/proxy/hooks","issue_events_url":"https://api.github.com/repos/kata-containers/proxy/issues/events{/number}","events_url":"https://api.github.com/repos/kata-containers/proxy/events","assignees_url":"https://api.github.com/repos/kata-containers/proxy/assignees{/user}","branches_url":"https://api.github.com/repos/kata-containers/proxy/branches{/branch}","tags_url":"https://api.github.com/repos/kata-containers/proxy/tags","blobs_url":"https://api.github.com/repos/kata-containers/proxy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kata-containers/proxy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kata-containers/proxy/git/refs{/sha}","trees_url":"https://api.github.com/repos/kata-containers/proxy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kata-containers/proxy/statuses/{sha}","languages_url":"https://api.github.com/repos/kata-containers/proxy/languages","stargazers_url":"https://api.github.com/repos/kata-containers/proxy/stargazers","contributors_url":"https://api.github.com/repos/kata-containers/proxy/contributors","subscribers_url":"https://api.github.com/repos/kata-containers/proxy/subscribers","subscription_url":"https://api.github.com/repos/kata-containers/proxy/subscription","commits_url":"https://api.github.com/repos/kata-containers/proxy/commits{/sha}","git_commits_url":"https://api.github.com/repos/kata-containers/proxy/git/commits{/sha}","comments_url":"https://api.github.com/repos/kata-containers/proxy/comments{/number}","issue_comment_url":"https://api.github.com/repos/kata-containers/proxy/issues/comments{/number}","contents_url":"https://api.github.com/repos/kata-containers/proxy/contents/{+path}","compare_url":"https://api.github.com/repos/kata-containers/proxy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kata-containers/proxy/merges","archive_url":"https://api.github.com/repos/kata-containers/proxy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kata-containers/proxy/downloads","issues_url":"https://api.github.com/repos/kata-containers/proxy/issues{/number}","pulls_url":"https://api.github.com/repos/kata-containers/proxy/pulls{/number}","milestones_url":"https://api.github.com/repos/kata-containers/proxy/milestones{/number}","notifications_url":"https://api.github.com/repos/kata-containers/proxy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kata-containers/proxy/labels{/name}","releases_url":"https://api.github.com/repos/kata-containers/proxy/releases{/id}","deployments_url":"https://api.github.com/repos/kata-containers/proxy/deployments","created_at":"2017-11-13T11:14:43Z","updated_at":"2018-01-31T14:39:42Z","pushed_at":"2018-02-01T05:17:19Z","git_url":"git://github.com/kata-containers/proxy.git","ssh_url":"git@github.com:kata-containers/proxy.git","clone_url":"https://github.com/kata-containers/proxy.git","svn_url":"https://github.com/kata-containers/proxy","homepage":null,"size":906,"stargazers_count":29,"watchers_count":29,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":22,"open_issues":6,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kata-containers/proxy/pulls/46"},"html":{"href":"https://github.com/kata-containers/proxy/pull/46"},"issue":{"href":"https://api.github.com/repos/kata-containers/proxy/issues/46"},"comments":{"href":"https://api.github.com/repos/kata-containers/proxy/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/kata-containers/proxy/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/kata-containers/proxy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kata-containers/proxy/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/kata-containers/proxy/statuses/ace09e49fa9efafc3b4b7c8d8f2fa7d7d7805e52"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jodh-intel"}}