{"action":"created","comment":{"url":"https://api.github.com/repos/senior-buddy/buddy/pulls/comments/142018666","pull_request_review_id":66325943,"id":142018666,"diff_hunk":"@@ -176,10 +183,20 @@ func serveWs(server *Server, w http.ResponseWriter, r *http.Request) {\n \t\treturn\n \t}\n \n-\tclient := &Client{server: server, conn: conn, send: make(chan []byte, 256), sendToken: make(chan SessionToken, 256)}\n+\tclient := &Client{\n+\t\tserver:    server,\n+\t\tconn:      conn,\n+\t\tsend:      make(chan []byte, sendMsgBufferSize),\n+\t\tsendToken: make(chan SessionToken, sendTokenBufferSize),\n+\t\tstart: make(chan struct{}),\n+\t}\n+\n \tclient.sendToken <- SessionToken(sessionToken)\n \tclient.server.register <- client\n \n-\tgo client.writePump()\n-\tgo client.readPump()\n+\tfunc() {\n+\t\t<-client.start","path":"client.go","position":125,"original_position":125,"commit_id":"29b65d0b7913aa47e67f91bcc1523e4e12b80190","original_commit_id":"29b65d0b7913aa47e67f91bcc1523e4e12b80190","user":{"login":"clandry94","id":5351125,"avatar_url":"https://avatars0.githubusercontent.com/u/5351125?v=4","gravatar_id":"","url":"https://api.github.com/users/clandry94","html_url":"https://github.com/clandry94","followers_url":"https://api.github.com/users/clandry94/followers","following_url":"https://api.github.com/users/clandry94/following{/other_user}","gists_url":"https://api.github.com/users/clandry94/gists{/gist_id}","starred_url":"https://api.github.com/users/clandry94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clandry94/subscriptions","organizations_url":"https://api.github.com/users/clandry94/orgs","repos_url":"https://api.github.com/users/clandry94/repos","events_url":"https://api.github.com/users/clandry94/events{/privacy}","received_events_url":"https://api.github.com/users/clandry94/received_events","type":"User","site_admin":false},"body":"When this channel closes, the two go routines can become sending and receiving data from the client\r\n","created_at":"2017-10-01T01:36:08Z","updated_at":"2017-10-01T01:36:08Z","html_url":"https://github.com/senior-buddy/buddy/pull/12#discussion_r142018666","pull_request_url":"https://api.github.com/repos/senior-buddy/buddy/pulls/12","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/senior-buddy/buddy/pulls/comments/142018666"},"html":{"href":"https://github.com/senior-buddy/buddy/pull/12#discussion_r142018666"},"pull_request":{"href":"https://api.github.com/repos/senior-buddy/buddy/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/senior-buddy/buddy/pulls/12","id":144051820,"html_url":"https://github.com/senior-buddy/buddy/pull/12","diff_url":"https://github.com/senior-buddy/buddy/pull/12.diff","patch_url":"https://github.com/senior-buddy/buddy/pull/12.patch","issue_url":"https://api.github.com/repos/senior-buddy/buddy/issues/12","number":12,"state":"open","locked":false,"title":"Fix bug where clients would hang if new connection rate was too high","user":{"login":"clandry94","id":5351125,"avatar_url":"https://avatars0.githubusercontent.com/u/5351125?v=4","gravatar_id":"","url":"https://api.github.com/users/clandry94","html_url":"https://github.com/clandry94","followers_url":"https://api.github.com/users/clandry94/followers","following_url":"https://api.github.com/users/clandry94/following{/other_user}","gists_url":"https://api.github.com/users/clandry94/gists{/gist_id}","starred_url":"https://api.github.com/users/clandry94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clandry94/subscriptions","organizations_url":"https://api.github.com/users/clandry94/orgs","repos_url":"https://api.github.com/users/clandry94/repos","events_url":"https://api.github.com/users/clandry94/events{/privacy}","received_events_url":"https://api.github.com/users/clandry94/received_events","type":"User","site_admin":false},"body":"Prior to this, if the connection rate was more than one connection per 0.01 seconds, the server would get into a race condition, then deadlock since client registration could not take place before the read and write pumps started. This fix makes the read and write pumps wait for a start channel to close, thus unblocking and acting as a starting gate, before starting the read and write pumps. ","created_at":"2017-10-01T01:34:49Z","updated_at":"2017-10-01T01:36:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b8fc4d858488666f4e979b0a00a9b03ec0547e6a","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/senior-buddy/buddy/pulls/12/commits","review_comments_url":"https://api.github.com/repos/senior-buddy/buddy/pulls/12/comments","review_comment_url":"https://api.github.com/repos/senior-buddy/buddy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/senior-buddy/buddy/issues/12/comments","statuses_url":"https://api.github.com/repos/senior-buddy/buddy/statuses/29b65d0b7913aa47e67f91bcc1523e4e12b80190","head":{"label":"senior-buddy:fix_hanging_bug","ref":"fix_hanging_bug","sha":"29b65d0b7913aa47e67f91bcc1523e4e12b80190","user":{"login":"senior-buddy","id":31717820,"avatar_url":"https://avatars3.githubusercontent.com/u/31717820?v=4","gravatar_id":"","url":"https://api.github.com/users/senior-buddy","html_url":"https://github.com/senior-buddy","followers_url":"https://api.github.com/users/senior-buddy/followers","following_url":"https://api.github.com/users/senior-buddy/following{/other_user}","gists_url":"https://api.github.com/users/senior-buddy/gists{/gist_id}","starred_url":"https://api.github.com/users/senior-buddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/senior-buddy/subscriptions","organizations_url":"https://api.github.com/users/senior-buddy/orgs","repos_url":"https://api.github.com/users/senior-buddy/repos","events_url":"https://api.github.com/users/senior-buddy/events{/privacy}","received_events_url":"https://api.github.com/users/senior-buddy/received_events","type":"Organization","site_admin":false},"repo":{"id":104118133,"name":"buddy","full_name":"senior-buddy/buddy","owner":{"login":"senior-buddy","id":31717820,"avatar_url":"https://avatars3.githubusercontent.com/u/31717820?v=4","gravatar_id":"","url":"https://api.github.com/users/senior-buddy","html_url":"https://github.com/senior-buddy","followers_url":"https://api.github.com/users/senior-buddy/followers","following_url":"https://api.github.com/users/senior-buddy/following{/other_user}","gists_url":"https://api.github.com/users/senior-buddy/gists{/gist_id}","starred_url":"https://api.github.com/users/senior-buddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/senior-buddy/subscriptions","organizations_url":"https://api.github.com/users/senior-buddy/orgs","repos_url":"https://api.github.com/users/senior-buddy/repos","events_url":"https://api.github.com/users/senior-buddy/events{/privacy}","received_events_url":"https://api.github.com/users/senior-buddy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/senior-buddy/buddy","description":null,"fork":false,"url":"https://api.github.com/repos/senior-buddy/buddy","forks_url":"https://api.github.com/repos/senior-buddy/buddy/forks","keys_url":"https://api.github.com/repos/senior-buddy/buddy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/senior-buddy/buddy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/senior-buddy/buddy/teams","hooks_url":"https://api.github.com/repos/senior-buddy/buddy/hooks","issue_events_url":"https://api.github.com/repos/senior-buddy/buddy/issues/events{/number}","events_url":"https://api.github.com/repos/senior-buddy/buddy/events","assignees_url":"https://api.github.com/repos/senior-buddy/buddy/assignees{/user}","branches_url":"https://api.github.com/repos/senior-buddy/buddy/branches{/branch}","tags_url":"https://api.github.com/repos/senior-buddy/buddy/tags","blobs_url":"https://api.github.com/repos/senior-buddy/buddy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/senior-buddy/buddy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/senior-buddy/buddy/git/refs{/sha}","trees_url":"https://api.github.com/repos/senior-buddy/buddy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/senior-buddy/buddy/statuses/{sha}","languages_url":"https://api.github.com/repos/senior-buddy/buddy/languages","stargazers_url":"https://api.github.com/repos/senior-buddy/buddy/stargazers","contributors_url":"https://api.github.com/repos/senior-buddy/buddy/contributors","subscribers_url":"https://api.github.com/repos/senior-buddy/buddy/subscribers","subscription_url":"https://api.github.com/repos/senior-buddy/buddy/subscription","commits_url":"https://api.github.com/repos/senior-buddy/buddy/commits{/sha}","git_commits_url":"https://api.github.com/repos/senior-buddy/buddy/git/commits{/sha}","comments_url":"https://api.github.com/repos/senior-buddy/buddy/comments{/number}","issue_comment_url":"https://api.github.com/repos/senior-buddy/buddy/issues/comments{/number}","contents_url":"https://api.github.com/repos/senior-buddy/buddy/contents/{+path}","compare_url":"https://api.github.com/repos/senior-buddy/buddy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/senior-buddy/buddy/merges","archive_url":"https://api.github.com/repos/senior-buddy/buddy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/senior-buddy/buddy/downloads","issues_url":"https://api.github.com/repos/senior-buddy/buddy/issues{/number}","pulls_url":"https://api.github.com/repos/senior-buddy/buddy/pulls{/number}","milestones_url":"https://api.github.com/repos/senior-buddy/buddy/milestones{/number}","notifications_url":"https://api.github.com/repos/senior-buddy/buddy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/senior-buddy/buddy/labels{/name}","releases_url":"https://api.github.com/repos/senior-buddy/buddy/releases{/id}","deployments_url":"https://api.github.com/repos/senior-buddy/buddy/deployments","created_at":"2017-09-19T19:20:42Z","updated_at":"2017-09-19T19:40:32Z","pushed_at":"2017-10-01T01:34:49Z","git_url":"git://github.com/senior-buddy/buddy.git","ssh_url":"git@github.com:senior-buddy/buddy.git","clone_url":"https://github.com/senior-buddy/buddy.git","svn_url":"https://github.com/senior-buddy/buddy","homepage":null,"size":33,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"senior-buddy:master","ref":"master","sha":"e630ddb929278c5c2deda820b370e953420d1ea4","user":{"login":"senior-buddy","id":31717820,"avatar_url":"https://avatars3.githubusercontent.com/u/31717820?v=4","gravatar_id":"","url":"https://api.github.com/users/senior-buddy","html_url":"https://github.com/senior-buddy","followers_url":"https://api.github.com/users/senior-buddy/followers","following_url":"https://api.github.com/users/senior-buddy/following{/other_user}","gists_url":"https://api.github.com/users/senior-buddy/gists{/gist_id}","starred_url":"https://api.github.com/users/senior-buddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/senior-buddy/subscriptions","organizations_url":"https://api.github.com/users/senior-buddy/orgs","repos_url":"https://api.github.com/users/senior-buddy/repos","events_url":"https://api.github.com/users/senior-buddy/events{/privacy}","received_events_url":"https://api.github.com/users/senior-buddy/received_events","type":"Organization","site_admin":false},"repo":{"id":104118133,"name":"buddy","full_name":"senior-buddy/buddy","owner":{"login":"senior-buddy","id":31717820,"avatar_url":"https://avatars3.githubusercontent.com/u/31717820?v=4","gravatar_id":"","url":"https://api.github.com/users/senior-buddy","html_url":"https://github.com/senior-buddy","followers_url":"https://api.github.com/users/senior-buddy/followers","following_url":"https://api.github.com/users/senior-buddy/following{/other_user}","gists_url":"https://api.github.com/users/senior-buddy/gists{/gist_id}","starred_url":"https://api.github.com/users/senior-buddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/senior-buddy/subscriptions","organizations_url":"https://api.github.com/users/senior-buddy/orgs","repos_url":"https://api.github.com/users/senior-buddy/repos","events_url":"https://api.github.com/users/senior-buddy/events{/privacy}","received_events_url":"https://api.github.com/users/senior-buddy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/senior-buddy/buddy","description":null,"fork":false,"url":"https://api.github.com/repos/senior-buddy/buddy","forks_url":"https://api.github.com/repos/senior-buddy/buddy/forks","keys_url":"https://api.github.com/repos/senior-buddy/buddy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/senior-buddy/buddy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/senior-buddy/buddy/teams","hooks_url":"https://api.github.com/repos/senior-buddy/buddy/hooks","issue_events_url":"https://api.github.com/repos/senior-buddy/buddy/issues/events{/number}","events_url":"https://api.github.com/repos/senior-buddy/buddy/events","assignees_url":"https://api.github.com/repos/senior-buddy/buddy/assignees{/user}","branches_url":"https://api.github.com/repos/senior-buddy/buddy/branches{/branch}","tags_url":"https://api.github.com/repos/senior-buddy/buddy/tags","blobs_url":"https://api.github.com/repos/senior-buddy/buddy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/senior-buddy/buddy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/senior-buddy/buddy/git/refs{/sha}","trees_url":"https://api.github.com/repos/senior-buddy/buddy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/senior-buddy/buddy/statuses/{sha}","languages_url":"https://api.github.com/repos/senior-buddy/buddy/languages","stargazers_url":"https://api.github.com/repos/senior-buddy/buddy/stargazers","contributors_url":"https://api.github.com/repos/senior-buddy/buddy/contributors","subscribers_url":"https://api.github.com/repos/senior-buddy/buddy/subscribers","subscription_url":"https://api.github.com/repos/senior-buddy/buddy/subscription","commits_url":"https://api.github.com/repos/senior-buddy/buddy/commits{/sha}","git_commits_url":"https://api.github.com/repos/senior-buddy/buddy/git/commits{/sha}","comments_url":"https://api.github.com/repos/senior-buddy/buddy/comments{/number}","issue_comment_url":"https://api.github.com/repos/senior-buddy/buddy/issues/comments{/number}","contents_url":"https://api.github.com/repos/senior-buddy/buddy/contents/{+path}","compare_url":"https://api.github.com/repos/senior-buddy/buddy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/senior-buddy/buddy/merges","archive_url":"https://api.github.com/repos/senior-buddy/buddy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/senior-buddy/buddy/downloads","issues_url":"https://api.github.com/repos/senior-buddy/buddy/issues{/number}","pulls_url":"https://api.github.com/repos/senior-buddy/buddy/pulls{/number}","milestones_url":"https://api.github.com/repos/senior-buddy/buddy/milestones{/number}","notifications_url":"https://api.github.com/repos/senior-buddy/buddy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/senior-buddy/buddy/labels{/name}","releases_url":"https://api.github.com/repos/senior-buddy/buddy/releases{/id}","deployments_url":"https://api.github.com/repos/senior-buddy/buddy/deployments","created_at":"2017-09-19T19:20:42Z","updated_at":"2017-09-19T19:40:32Z","pushed_at":"2017-10-01T01:34:49Z","git_url":"git://github.com/senior-buddy/buddy.git","ssh_url":"git@github.com:senior-buddy/buddy.git","clone_url":"https://github.com/senior-buddy/buddy.git","svn_url":"https://github.com/senior-buddy/buddy","homepage":null,"size":33,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/senior-buddy/buddy/pulls/12"},"html":{"href":"https://github.com/senior-buddy/buddy/pull/12"},"issue":{"href":"https://api.github.com/repos/senior-buddy/buddy/issues/12"},"comments":{"href":"https://api.github.com/repos/senior-buddy/buddy/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/senior-buddy/buddy/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/senior-buddy/buddy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/senior-buddy/buddy/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/senior-buddy/buddy/statuses/29b65d0b7913aa47e67f91bcc1523e4e12b80190"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"clandry94"}}