{"action":"created","comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments/39191313","id":39191313,"diff_hunk":"@@ -428,14 +436,18 @@ type state struct {\n \tgroups    map[proto.RangeID]*group\n \tnodes     map[proto.RaftNodeID]*node\n \twriteTask *writeTask\n+\t// buffer the event if s.Events channel is full to avoid the deadlock\n+\t// between s.Events channel and callbackChan.\n+\tpendingEvents []interface{}","path":"multiraft/multiraft.go","position":28,"original_position":28,"commit_id":"b0fc7d17d8a2cb7d06022ef56713f0bbd1400054","original_commit_id":"b0fc7d17d8a2cb7d06022ef56713f0bbd1400054","user":{"login":"bdarnell","id":160562,"avatar_url":"https://avatars.githubusercontent.com/u/160562?v=3","gravatar_id":"","url":"https://api.github.com/users/bdarnell","html_url":"https://github.com/bdarnell","followers_url":"https://api.github.com/users/bdarnell/followers","following_url":"https://api.github.com/users/bdarnell/following{/other_user}","gists_url":"https://api.github.com/users/bdarnell/gists{/gist_id}","starred_url":"https://api.github.com/users/bdarnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdarnell/subscriptions","organizations_url":"https://api.github.com/users/bdarnell/orgs","repos_url":"https://api.github.com/users/bdarnell/repos","events_url":"https://api.github.com/users/bdarnell/events{/privacy}","received_events_url":"https://api.github.com/users/bdarnell/received_events","type":"User","site_admin":false},"body":"We now have two kinds of buffers for events: this slice and the buffer in the channel itself. I don't think it makes sense to keep both. Make the `Events` channel unbuffered and only write to it in the select loop(s) (removing the EventBufferSize setting). In `sendEvent`, always append to the slice and don't touch the channel.","created_at":"2015-09-10T17:55:24Z","updated_at":"2015-09-10T17:55:24Z","html_url":"https://github.com/cockroachdb/cockroach/pull/2448#discussion_r39191313","pull_request_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2448","_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments/39191313"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/2448#discussion_r39191313"},"pull_request":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2448"}}},"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2448","id":44679822,"html_url":"https://github.com/cockroachdb/cockroach/pull/2448","diff_url":"https://github.com/cockroachdb/cockroach/pull/2448.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/2448.patch","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/2448","number":2448,"state":"open","locked":false,"title":"try to resolve the deadlock between multiraft eventsChan and callbackChan and advance after ApplyConfChanges","user":{"login":"es-chow","id":11871102,"avatar_url":"https://avatars.githubusercontent.com/u/11871102?v=3","gravatar_id":"","url":"https://api.github.com/users/es-chow","html_url":"https://github.com/es-chow","followers_url":"https://api.github.com/users/es-chow/followers","following_url":"https://api.github.com/users/es-chow/following{/other_user}","gists_url":"https://api.github.com/users/es-chow/gists{/gist_id}","starred_url":"https://api.github.com/users/es-chow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/es-chow/subscriptions","organizations_url":"https://api.github.com/users/es-chow/orgs","repos_url":"https://api.github.com/users/es-chow/repos","events_url":"https://api.github.com/users/es-chow/events{/privacy}","received_events_url":"https://api.github.com/users/es-chow/received_events","type":"User","site_admin":false},"body":"try to resolve the #1185 and make s.Multinode.Advance after ApplyConfChange.","created_at":"2015-09-10T15:10:34Z","updated_at":"2015-09-10T17:55:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"945cfc4611a85ba5aca19e24f411780dcb12e221","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2448/commits","review_comments_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2448/comments","review_comment_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/2448/comments","statuses_url":"https://api.github.com/repos/cockroachdb/cockroach/statuses/b0fc7d17d8a2cb7d06022ef56713f0bbd1400054","head":{"label":"es-chow:fix-multiraft-events-callback-deadlock","ref":"fix-multiraft-events-callback-deadlock","sha":"b0fc7d17d8a2cb7d06022ef56713f0bbd1400054","user":{"login":"es-chow","id":11871102,"avatar_url":"https://avatars.githubusercontent.com/u/11871102?v=3","gravatar_id":"","url":"https://api.github.com/users/es-chow","html_url":"https://github.com/es-chow","followers_url":"https://api.github.com/users/es-chow/followers","following_url":"https://api.github.com/users/es-chow/following{/other_user}","gists_url":"https://api.github.com/users/es-chow/gists{/gist_id}","starred_url":"https://api.github.com/users/es-chow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/es-chow/subscriptions","organizations_url":"https://api.github.com/users/es-chow/orgs","repos_url":"https://api.github.com/users/es-chow/repos","events_url":"https://api.github.com/users/es-chow/events{/privacy}","received_events_url":"https://api.github.com/users/es-chow/received_events","type":"User","site_admin":false},"repo":{"id":33779013,"name":"cockroach","full_name":"es-chow/cockroach","owner":{"login":"es-chow","id":11871102,"avatar_url":"https://avatars.githubusercontent.com/u/11871102?v=3","gravatar_id":"","url":"https://api.github.com/users/es-chow","html_url":"https://github.com/es-chow","followers_url":"https://api.github.com/users/es-chow/followers","following_url":"https://api.github.com/users/es-chow/following{/other_user}","gists_url":"https://api.github.com/users/es-chow/gists{/gist_id}","starred_url":"https://api.github.com/users/es-chow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/es-chow/subscriptions","organizations_url":"https://api.github.com/users/es-chow/orgs","repos_url":"https://api.github.com/users/es-chow/repos","events_url":"https://api.github.com/users/es-chow/events{/privacy}","received_events_url":"https://api.github.com/users/es-chow/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/es-chow/cockroach","description":"A Scalable, Geo-Replicated, Transactional Datastore","fork":true,"url":"https://api.github.com/repos/es-chow/cockroach","forks_url":"https://api.github.com/repos/es-chow/cockroach/forks","keys_url":"https://api.github.com/repos/es-chow/cockroach/keys{/key_id}","collaborators_url":"https://api.github.com/repos/es-chow/cockroach/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/es-chow/cockroach/teams","hooks_url":"https://api.github.com/repos/es-chow/cockroach/hooks","issue_events_url":"https://api.github.com/repos/es-chow/cockroach/issues/events{/number}","events_url":"https://api.github.com/repos/es-chow/cockroach/events","assignees_url":"https://api.github.com/repos/es-chow/cockroach/assignees{/user}","branches_url":"https://api.github.com/repos/es-chow/cockroach/branches{/branch}","tags_url":"https://api.github.com/repos/es-chow/cockroach/tags","blobs_url":"https://api.github.com/repos/es-chow/cockroach/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/es-chow/cockroach/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/es-chow/cockroach/git/refs{/sha}","trees_url":"https://api.github.com/repos/es-chow/cockroach/git/trees{/sha}","statuses_url":"https://api.github.com/repos/es-chow/cockroach/statuses/{sha}","languages_url":"https://api.github.com/repos/es-chow/cockroach/languages","stargazers_url":"https://api.github.com/repos/es-chow/cockroach/stargazers","contributors_url":"https://api.github.com/repos/es-chow/cockroach/contributors","subscribers_url":"https://api.github.com/repos/es-chow/cockroach/subscribers","subscription_url":"https://api.github.com/repos/es-chow/cockroach/subscription","commits_url":"https://api.github.com/repos/es-chow/cockroach/commits{/sha}","git_commits_url":"https://api.github.com/repos/es-chow/cockroach/git/commits{/sha}","comments_url":"https://api.github.com/repos/es-chow/cockroach/comments{/number}","issue_comment_url":"https://api.github.com/repos/es-chow/cockroach/issues/comments{/number}","contents_url":"https://api.github.com/repos/es-chow/cockroach/contents/{+path}","compare_url":"https://api.github.com/repos/es-chow/cockroach/compare/{base}...{head}","merges_url":"https://api.github.com/repos/es-chow/cockroach/merges","archive_url":"https://api.github.com/repos/es-chow/cockroach/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/es-chow/cockroach/downloads","issues_url":"https://api.github.com/repos/es-chow/cockroach/issues{/number}","pulls_url":"https://api.github.com/repos/es-chow/cockroach/pulls{/number}","milestones_url":"https://api.github.com/repos/es-chow/cockroach/milestones{/number}","notifications_url":"https://api.github.com/repos/es-chow/cockroach/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/es-chow/cockroach/labels{/name}","releases_url":"https://api.github.com/repos/es-chow/cockroach/releases{/id}","created_at":"2015-04-11T14:36:53Z","updated_at":"2015-04-28T14:15:38Z","pushed_at":"2015-09-10T14:54:06Z","git_url":"git://github.com/es-chow/cockroach.git","ssh_url":"git@github.com:es-chow/cockroach.git","clone_url":"https://github.com/es-chow/cockroach.git","svn_url":"https://github.com/es-chow/cockroach","homepage":null,"size":30302,"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":"cockroachdb:master","ref":"master","sha":"4e055b03f32eeb40c1072a04d4b3b9677628d1ef","user":{"login":"cockroachdb","id":6748139,"avatar_url":"https://avatars.githubusercontent.com/u/6748139?v=3","gravatar_id":"","url":"https://api.github.com/users/cockroachdb","html_url":"https://github.com/cockroachdb","followers_url":"https://api.github.com/users/cockroachdb/followers","following_url":"https://api.github.com/users/cockroachdb/following{/other_user}","gists_url":"https://api.github.com/users/cockroachdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cockroachdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cockroachdb/subscriptions","organizations_url":"https://api.github.com/users/cockroachdb/orgs","repos_url":"https://api.github.com/users/cockroachdb/repos","events_url":"https://api.github.com/users/cockroachdb/events{/privacy}","received_events_url":"https://api.github.com/users/cockroachdb/received_events","type":"Organization","site_admin":false},"repo":{"id":16563587,"name":"cockroach","full_name":"cockroachdb/cockroach","owner":{"login":"cockroachdb","id":6748139,"avatar_url":"https://avatars.githubusercontent.com/u/6748139?v=3","gravatar_id":"","url":"https://api.github.com/users/cockroachdb","html_url":"https://github.com/cockroachdb","followers_url":"https://api.github.com/users/cockroachdb/followers","following_url":"https://api.github.com/users/cockroachdb/following{/other_user}","gists_url":"https://api.github.com/users/cockroachdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cockroachdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cockroachdb/subscriptions","organizations_url":"https://api.github.com/users/cockroachdb/orgs","repos_url":"https://api.github.com/users/cockroachdb/repos","events_url":"https://api.github.com/users/cockroachdb/events{/privacy}","received_events_url":"https://api.github.com/users/cockroachdb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cockroachdb/cockroach","description":"A Scalable, Geo-Replicated, Transactional Datastore","fork":false,"url":"https://api.github.com/repos/cockroachdb/cockroach","forks_url":"https://api.github.com/repos/cockroachdb/cockroach/forks","keys_url":"https://api.github.com/repos/cockroachdb/cockroach/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cockroachdb/cockroach/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cockroachdb/cockroach/teams","hooks_url":"https://api.github.com/repos/cockroachdb/cockroach/hooks","issue_events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/events{/number}","events_url":"https://api.github.com/repos/cockroachdb/cockroach/events","assignees_url":"https://api.github.com/repos/cockroachdb/cockroach/assignees{/user}","branches_url":"https://api.github.com/repos/cockroachdb/cockroach/branches{/branch}","tags_url":"https://api.github.com/repos/cockroachdb/cockroach/tags","blobs_url":"https://api.github.com/repos/cockroachdb/cockroach/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cockroachdb/cockroach/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cockroachdb/cockroach/git/refs{/sha}","trees_url":"https://api.github.com/repos/cockroachdb/cockroach/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cockroachdb/cockroach/statuses/{sha}","languages_url":"https://api.github.com/repos/cockroachdb/cockroach/languages","stargazers_url":"https://api.github.com/repos/cockroachdb/cockroach/stargazers","contributors_url":"https://api.github.com/repos/cockroachdb/cockroach/contributors","subscribers_url":"https://api.github.com/repos/cockroachdb/cockroach/subscribers","subscription_url":"https://api.github.com/repos/cockroachdb/cockroach/subscription","commits_url":"https://api.github.com/repos/cockroachdb/cockroach/commits{/sha}","git_commits_url":"https://api.github.com/repos/cockroachdb/cockroach/git/commits{/sha}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/comments{/number}","issue_comment_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments{/number}","contents_url":"https://api.github.com/repos/cockroachdb/cockroach/contents/{+path}","compare_url":"https://api.github.com/repos/cockroachdb/cockroach/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cockroachdb/cockroach/merges","archive_url":"https://api.github.com/repos/cockroachdb/cockroach/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cockroachdb/cockroach/downloads","issues_url":"https://api.github.com/repos/cockroachdb/cockroach/issues{/number}","pulls_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls{/number}","milestones_url":"https://api.github.com/repos/cockroachdb/cockroach/milestones{/number}","notifications_url":"https://api.github.com/repos/cockroachdb/cockroach/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/labels{/name}","releases_url":"https://api.github.com/repos/cockroachdb/cockroach/releases{/id}","created_at":"2014-02-06T00:18:47Z","updated_at":"2015-09-10T15:11:33Z","pushed_at":"2015-09-10T17:44:09Z","git_url":"git://github.com/cockroachdb/cockroach.git","ssh_url":"git@github.com:cockroachdb/cockroach.git","clone_url":"https://github.com/cockroachdb/cockroach.git","svn_url":"https://github.com/cockroachdb/cockroach","homepage":null,"size":53144,"stargazers_count":5202,"watchers_count":5202,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":417,"mirror_url":null,"open_issues_count":168,"forks":417,"open_issues":168,"watchers":5202,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2448"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/2448"},"issue":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/2448"},"comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/2448/comments"},"review_comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2448/comments"},"review_comment":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2448/commits"},"statuses":{"href":"https://api.github.com/repos/cockroachdb/cockroach/statuses/b0fc7d17d8a2cb7d06022ef56713f0bbd1400054"}}}}