{"action":"created","comment":{"url":"https://api.github.com/repos/improbable-eng/grpc-web/pulls/comments/223035915","pull_request_review_id":162072769,"id":223035915,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzAzNTkxNQ==","diff_hunk":"@@ -148,14 +149,17 @@ func (w *WrappedGrpcServer) handleWebSocket(wsConn *websocket.Conn, req *http.Re\n \t\treturn\n \t}\n \n+\tctx, cancelFunc := context.WithCancel(req.Context())\n+\tdefer cancelFunc()","path":"go/grpcweb/wrapper.go","position":13,"original_position":13,"commit_id":"5f58b7f86c364ad2fc4b642bac30d032227f6535","original_commit_id":"5f58b7f86c364ad2fc4b642bac30d032227f6535","user":{"login":"johanbrandhorst","id":6604151,"node_id":"MDQ6VXNlcjY2MDQxNTE=","avatar_url":"https://avatars2.githubusercontent.com/u/6604151?v=4","gravatar_id":"","url":"https://api.github.com/users/johanbrandhorst","html_url":"https://github.com/johanbrandhorst","followers_url":"https://api.github.com/users/johanbrandhorst/followers","following_url":"https://api.github.com/users/johanbrandhorst/following{/other_user}","gists_url":"https://api.github.com/users/johanbrandhorst/gists{/gist_id}","starred_url":"https://api.github.com/users/johanbrandhorst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanbrandhorst/subscriptions","organizations_url":"https://api.github.com/users/johanbrandhorst/orgs","repos_url":"https://api.github.com/users/johanbrandhorst/repos","events_url":"https://api.github.com/users/johanbrandhorst/events{/privacy}","received_events_url":"https://api.github.com/users/johanbrandhorst/received_events","type":"User","site_admin":false},"body":"Do we need to explicitly cancel this? Can we not rely on the built-in request context being cancelled?","created_at":"2018-10-05T14:55:27Z","updated_at":"2018-10-05T14:58:45Z","html_url":"https://github.com/improbable-eng/grpc-web/pull/253#discussion_r223035915","pull_request_url":"https://api.github.com/repos/improbable-eng/grpc-web/pulls/253","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/improbable-eng/grpc-web/pulls/comments/223035915"},"html":{"href":"https://github.com/improbable-eng/grpc-web/pull/253#discussion_r223035915"},"pull_request":{"href":"https://api.github.com/repos/improbable-eng/grpc-web/pulls/253"}}},"pull_request":{"url":"https://api.github.com/repos/improbable-eng/grpc-web/pulls/253","id":220727970,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIwNzI3OTcw","html_url":"https://github.com/improbable-eng/grpc-web/pull/253","diff_url":"https://github.com/improbable-eng/grpc-web/pull/253.diff","patch_url":"https://github.com/improbable-eng/grpc-web/pull/253.patch","issue_url":"https://api.github.com/repos/improbable-eng/grpc-web/issues/253","number":253,"state":"open","locked":false,"title":"Prevent leaking goroutines from websocket connections","user":{"login":"amerry","id":8223327,"node_id":"MDQ6VXNlcjgyMjMzMjc=","avatar_url":"https://avatars0.githubusercontent.com/u/8223327?v=4","gravatar_id":"","url":"https://api.github.com/users/amerry","html_url":"https://github.com/amerry","followers_url":"https://api.github.com/users/amerry/followers","following_url":"https://api.github.com/users/amerry/following{/other_user}","gists_url":"https://api.github.com/users/amerry/gists{/gist_id}","starred_url":"https://api.github.com/users/amerry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amerry/subscriptions","organizations_url":"https://api.github.com/users/amerry/orgs","repos_url":"https://api.github.com/users/amerry/repos","events_url":"https://api.github.com/users/amerry/events{/privacy}","received_events_url":"https://api.github.com/users/amerry/received_events","type":"User","site_admin":false},"body":"The write to the CloseNotify() channel was blocking, preventing the\r\nRead() call from exiting, and preventing ServeHTTP from returning. This\r\nmeant that requests tended to stay around forever in a deadlocked state.\r\n\r\nUsing the context package prevent this, as the cancellation is\r\nnon-blocking. It depends on Go 1.7.\r\n\r\nNote that the writer still needs to support the CloseNotifier interface,\r\notherwise other things break, but it does not seem to be necessary to\r\nsignal using it.","created_at":"2018-10-05T14:50:14Z","updated_at":"2018-10-05T14:58:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cde0b4f802803d53b6208010d33f96dac6b22365","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/improbable-eng/grpc-web/pulls/253/commits","review_comments_url":"https://api.github.com/repos/improbable-eng/grpc-web/pulls/253/comments","review_comment_url":"https://api.github.com/repos/improbable-eng/grpc-web/pulls/comments{/number}","comments_url":"https://api.github.com/repos/improbable-eng/grpc-web/issues/253/comments","statuses_url":"https://api.github.com/repos/improbable-eng/grpc-web/statuses/5f58b7f86c364ad2fc4b642bac30d032227f6535","head":{"label":"amerry:websockets-memory-leak","ref":"websockets-memory-leak","sha":"5f58b7f86c364ad2fc4b642bac30d032227f6535","user":{"login":"amerry","id":8223327,"node_id":"MDQ6VXNlcjgyMjMzMjc=","avatar_url":"https://avatars0.githubusercontent.com/u/8223327?v=4","gravatar_id":"","url":"https://api.github.com/users/amerry","html_url":"https://github.com/amerry","followers_url":"https://api.github.com/users/amerry/followers","following_url":"https://api.github.com/users/amerry/following{/other_user}","gists_url":"https://api.github.com/users/amerry/gists{/gist_id}","starred_url":"https://api.github.com/users/amerry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amerry/subscriptions","organizations_url":"https://api.github.com/users/amerry/orgs","repos_url":"https://api.github.com/users/amerry/repos","events_url":"https://api.github.com/users/amerry/events{/privacy}","received_events_url":"https://api.github.com/users/amerry/received_events","type":"User","site_admin":false},"repo":{"id":137240317,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcyNDAzMTc=","name":"grpc-web","full_name":"amerry/grpc-web","private":false,"owner":{"login":"amerry","id":8223327,"node_id":"MDQ6VXNlcjgyMjMzMjc=","avatar_url":"https://avatars0.githubusercontent.com/u/8223327?v=4","gravatar_id":"","url":"https://api.github.com/users/amerry","html_url":"https://github.com/amerry","followers_url":"https://api.github.com/users/amerry/followers","following_url":"https://api.github.com/users/amerry/following{/other_user}","gists_url":"https://api.github.com/users/amerry/gists{/gist_id}","starred_url":"https://api.github.com/users/amerry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amerry/subscriptions","organizations_url":"https://api.github.com/users/amerry/orgs","repos_url":"https://api.github.com/users/amerry/repos","events_url":"https://api.github.com/users/amerry/events{/privacy}","received_events_url":"https://api.github.com/users/amerry/received_events","type":"User","site_admin":false},"html_url":"https://github.com/amerry/grpc-web","description":"gRPC Web implementation for Golang and TypeScript","fork":true,"url":"https://api.github.com/repos/amerry/grpc-web","forks_url":"https://api.github.com/repos/amerry/grpc-web/forks","keys_url":"https://api.github.com/repos/amerry/grpc-web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amerry/grpc-web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amerry/grpc-web/teams","hooks_url":"https://api.github.com/repos/amerry/grpc-web/hooks","issue_events_url":"https://api.github.com/repos/amerry/grpc-web/issues/events{/number}","events_url":"https://api.github.com/repos/amerry/grpc-web/events","assignees_url":"https://api.github.com/repos/amerry/grpc-web/assignees{/user}","branches_url":"https://api.github.com/repos/amerry/grpc-web/branches{/branch}","tags_url":"https://api.github.com/repos/amerry/grpc-web/tags","blobs_url":"https://api.github.com/repos/amerry/grpc-web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amerry/grpc-web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amerry/grpc-web/git/refs{/sha}","trees_url":"https://api.github.com/repos/amerry/grpc-web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amerry/grpc-web/statuses/{sha}","languages_url":"https://api.github.com/repos/amerry/grpc-web/languages","stargazers_url":"https://api.github.com/repos/amerry/grpc-web/stargazers","contributors_url":"https://api.github.com/repos/amerry/grpc-web/contributors","subscribers_url":"https://api.github.com/repos/amerry/grpc-web/subscribers","subscription_url":"https://api.github.com/repos/amerry/grpc-web/subscription","commits_url":"https://api.github.com/repos/amerry/grpc-web/commits{/sha}","git_commits_url":"https://api.github.com/repos/amerry/grpc-web/git/commits{/sha}","comments_url":"https://api.github.com/repos/amerry/grpc-web/comments{/number}","issue_comment_url":"https://api.github.com/repos/amerry/grpc-web/issues/comments{/number}","contents_url":"https://api.github.com/repos/amerry/grpc-web/contents/{+path}","compare_url":"https://api.github.com/repos/amerry/grpc-web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amerry/grpc-web/merges","archive_url":"https://api.github.com/repos/amerry/grpc-web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amerry/grpc-web/downloads","issues_url":"https://api.github.com/repos/amerry/grpc-web/issues{/number}","pulls_url":"https://api.github.com/repos/amerry/grpc-web/pulls{/number}","milestones_url":"https://api.github.com/repos/amerry/grpc-web/milestones{/number}","notifications_url":"https://api.github.com/repos/amerry/grpc-web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amerry/grpc-web/labels{/name}","releases_url":"https://api.github.com/repos/amerry/grpc-web/releases{/id}","deployments_url":"https://api.github.com/repos/amerry/grpc-web/deployments","created_at":"2018-06-13T16:11:25Z","updated_at":"2018-06-13T16:11:27Z","pushed_at":"2018-10-05T14:49:36Z","git_url":"git://github.com/amerry/grpc-web.git","ssh_url":"git@github.com:amerry/grpc-web.git","clone_url":"https://github.com/amerry/grpc-web.git","svn_url":"https://github.com/amerry/grpc-web","homepage":"","size":972,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","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":{"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":"improbable-eng:master","ref":"master","sha":"b89ec6300fb9ce3f604ff02c22e1c106fe29a3b9","user":{"login":"improbable-eng","id":26084283,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2MDg0Mjgz","avatar_url":"https://avatars2.githubusercontent.com/u/26084283?v=4","gravatar_id":"","url":"https://api.github.com/users/improbable-eng","html_url":"https://github.com/improbable-eng","followers_url":"https://api.github.com/users/improbable-eng/followers","following_url":"https://api.github.com/users/improbable-eng/following{/other_user}","gists_url":"https://api.github.com/users/improbable-eng/gists{/gist_id}","starred_url":"https://api.github.com/users/improbable-eng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/improbable-eng/subscriptions","organizations_url":"https://api.github.com/users/improbable-eng/orgs","repos_url":"https://api.github.com/users/improbable-eng/repos","events_url":"https://api.github.com/users/improbable-eng/events{/privacy}","received_events_url":"https://api.github.com/users/improbable-eng/received_events","type":"Organization","site_admin":false},"repo":{"id":64409189,"node_id":"MDEwOlJlcG9zaXRvcnk2NDQwOTE4OQ==","name":"grpc-web","full_name":"improbable-eng/grpc-web","private":false,"owner":{"login":"improbable-eng","id":26084283,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2MDg0Mjgz","avatar_url":"https://avatars2.githubusercontent.com/u/26084283?v=4","gravatar_id":"","url":"https://api.github.com/users/improbable-eng","html_url":"https://github.com/improbable-eng","followers_url":"https://api.github.com/users/improbable-eng/followers","following_url":"https://api.github.com/users/improbable-eng/following{/other_user}","gists_url":"https://api.github.com/users/improbable-eng/gists{/gist_id}","starred_url":"https://api.github.com/users/improbable-eng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/improbable-eng/subscriptions","organizations_url":"https://api.github.com/users/improbable-eng/orgs","repos_url":"https://api.github.com/users/improbable-eng/repos","events_url":"https://api.github.com/users/improbable-eng/events{/privacy}","received_events_url":"https://api.github.com/users/improbable-eng/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/improbable-eng/grpc-web","description":"gRPC Web implementation for Golang and TypeScript","fork":false,"url":"https://api.github.com/repos/improbable-eng/grpc-web","forks_url":"https://api.github.com/repos/improbable-eng/grpc-web/forks","keys_url":"https://api.github.com/repos/improbable-eng/grpc-web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/improbable-eng/grpc-web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/improbable-eng/grpc-web/teams","hooks_url":"https://api.github.com/repos/improbable-eng/grpc-web/hooks","issue_events_url":"https://api.github.com/repos/improbable-eng/grpc-web/issues/events{/number}","events_url":"https://api.github.com/repos/improbable-eng/grpc-web/events","assignees_url":"https://api.github.com/repos/improbable-eng/grpc-web/assignees{/user}","branches_url":"https://api.github.com/repos/improbable-eng/grpc-web/branches{/branch}","tags_url":"https://api.github.com/repos/improbable-eng/grpc-web/tags","blobs_url":"https://api.github.com/repos/improbable-eng/grpc-web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/improbable-eng/grpc-web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/improbable-eng/grpc-web/git/refs{/sha}","trees_url":"https://api.github.com/repos/improbable-eng/grpc-web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/improbable-eng/grpc-web/statuses/{sha}","languages_url":"https://api.github.com/repos/improbable-eng/grpc-web/languages","stargazers_url":"https://api.github.com/repos/improbable-eng/grpc-web/stargazers","contributors_url":"https://api.github.com/repos/improbable-eng/grpc-web/contributors","subscribers_url":"https://api.github.com/repos/improbable-eng/grpc-web/subscribers","subscription_url":"https://api.github.com/repos/improbable-eng/grpc-web/subscription","commits_url":"https://api.github.com/repos/improbable-eng/grpc-web/commits{/sha}","git_commits_url":"https://api.github.com/repos/improbable-eng/grpc-web/git/commits{/sha}","comments_url":"https://api.github.com/repos/improbable-eng/grpc-web/comments{/number}","issue_comment_url":"https://api.github.com/repos/improbable-eng/grpc-web/issues/comments{/number}","contents_url":"https://api.github.com/repos/improbable-eng/grpc-web/contents/{+path}","compare_url":"https://api.github.com/repos/improbable-eng/grpc-web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/improbable-eng/grpc-web/merges","archive_url":"https://api.github.com/repos/improbable-eng/grpc-web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/improbable-eng/grpc-web/downloads","issues_url":"https://api.github.com/repos/improbable-eng/grpc-web/issues{/number}","pulls_url":"https://api.github.com/repos/improbable-eng/grpc-web/pulls{/number}","milestones_url":"https://api.github.com/repos/improbable-eng/grpc-web/milestones{/number}","notifications_url":"https://api.github.com/repos/improbable-eng/grpc-web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/improbable-eng/grpc-web/labels{/name}","releases_url":"https://api.github.com/repos/improbable-eng/grpc-web/releases{/id}","deployments_url":"https://api.github.com/repos/improbable-eng/grpc-web/deployments","created_at":"2016-07-28T15:58:43Z","updated_at":"2018-10-03T18:42:57Z","pushed_at":"2018-10-05T14:50:15Z","git_url":"git://github.com/improbable-eng/grpc-web.git","ssh_url":"git@github.com:improbable-eng/grpc-web.git","clone_url":"https://github.com/improbable-eng/grpc-web.git","svn_url":"https://github.com/improbable-eng/grpc-web","homepage":"","size":970,"stargazers_count":1729,"watchers_count":1729,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":157,"mirror_url":null,"archived":false,"open_issues_count":41,"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":157,"open_issues":41,"watchers":1729,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/improbable-eng/grpc-web/pulls/253"},"html":{"href":"https://github.com/improbable-eng/grpc-web/pull/253"},"issue":{"href":"https://api.github.com/repos/improbable-eng/grpc-web/issues/253"},"comments":{"href":"https://api.github.com/repos/improbable-eng/grpc-web/issues/253/comments"},"review_comments":{"href":"https://api.github.com/repos/improbable-eng/grpc-web/pulls/253/comments"},"review_comment":{"href":"https://api.github.com/repos/improbable-eng/grpc-web/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/improbable-eng/grpc-web/pulls/253/commits"},"statuses":{"href":"https://api.github.com/repos/improbable-eng/grpc-web/statuses/5f58b7f86c364ad2fc4b642bac30d032227f6535"}},"author_association":"NONE"}}
{"actor":{"display_login":"johanbrandhorst"}}