{"action":"created","comment":{"url":"https://api.github.com/repos/hashicorp/raft/pulls/comments/73995858","id":73995858,"diff_hunk":"@@ -253,17 +259,19 @@ func NewRaft(conf *Config, fsm FSM, logs LogStore, stable StableStore, snaps Sna\n \n \t// Create Raft struct\n \tr := &Raft{\n-\t\tapplyCh:       make(chan *logFuture),\n-\t\tconf:          conf,\n-\t\tfsm:           fsm,\n-\t\tfsmCommitCh:   make(chan commitTuple, 128),\n-\t\tfsmRestoreCh:  make(chan *restoreFuture),\n-\t\tfsmSnapshotCh: make(chan *reqSnapshotFuture),\n-\t\tleaderCh:      make(chan bool),\n-\t\tlocalID:       localID,\n-\t\tlocalAddr:     localAddr,\n-\t\tlogger:        logger,\n-\t\tlogs:          logs,\n+\t\tpeerProgressCh: make(chan peerProgress, 0),","path":"api.go","position":35,"original_position":35,"commit_id":"2fc1608bb9619409daca2f9b460c2263a645d1c1","original_commit_id":"2fc1608bb9619409daca2f9b460c2263a645d1c1","user":{"login":"superfell","id":399098,"avatar_url":"https://avatars.githubusercontent.com/u/399098?v=3","gravatar_id":"","url":"https://api.github.com/users/superfell","html_url":"https://github.com/superfell","followers_url":"https://api.github.com/users/superfell/followers","following_url":"https://api.github.com/users/superfell/following{/other_user}","gists_url":"https://api.github.com/users/superfell/gists{/gist_id}","starred_url":"https://api.github.com/users/superfell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superfell/subscriptions","organizations_url":"https://api.github.com/users/superfell/orgs","repos_url":"https://api.github.com/users/superfell/repos","events_url":"https://api.github.com/users/superfell/events{/privacy}","received_events_url":"https://api.github.com/users/superfell/received_events","type":"User","site_admin":false},"body":",0 ? should leave it out for an unbuffered channel.","created_at":"2016-08-09T04:18:52Z","updated_at":"2016-08-09T04:18:52Z","html_url":"https://github.com/hashicorp/raft/pull/136#discussion_r73995858","pull_request_url":"https://api.github.com/repos/hashicorp/raft/pulls/136","_links":{"self":{"href":"https://api.github.com/repos/hashicorp/raft/pulls/comments/73995858"},"html":{"href":"https://github.com/hashicorp/raft/pull/136#discussion_r73995858"},"pull_request":{"href":"https://api.github.com/repos/hashicorp/raft/pulls/136"}}},"pull_request":{"url":"https://api.github.com/repos/hashicorp/raft/pulls/136","id":77046916,"html_url":"https://github.com/hashicorp/raft/pull/136","diff_url":"https://github.com/hashicorp/raft/pull/136.diff","patch_url":"https://github.com/hashicorp/raft/pull/136.patch","issue_url":"https://api.github.com/repos/hashicorp/raft/issues/136","number":136,"state":"open","locked":false,"title":"Rework goroutines and synchronization","user":{"login":"ongardie-sfdc","id":18755487,"avatar_url":"https://avatars.githubusercontent.com/u/18755487?v=3","gravatar_id":"","url":"https://api.github.com/users/ongardie-sfdc","html_url":"https://github.com/ongardie-sfdc","followers_url":"https://api.github.com/users/ongardie-sfdc/followers","following_url":"https://api.github.com/users/ongardie-sfdc/following{/other_user}","gists_url":"https://api.github.com/users/ongardie-sfdc/gists{/gist_id}","starred_url":"https://api.github.com/users/ongardie-sfdc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ongardie-sfdc/subscriptions","organizations_url":"https://api.github.com/users/ongardie-sfdc/orgs","repos_url":"https://api.github.com/users/ongardie-sfdc/repos","events_url":"https://api.github.com/users/ongardie-sfdc/events{/privacy}","received_events_url":"https://api.github.com/users/ongardie-sfdc/received_events","type":"User","site_admin":false},"body":"Today, the division of work and the synchronization between goroutines gets to be hard to follow in places. I think we can do better, to make the library more maintainable and eliminate potential race conditions from accidentally shared state. Ideally, it'll become more unit testable too.\r\n\r\nThis commit includes a diagram and description of where I think we should go. I'm open to feedback on it. Some of it's probably underspecified, with details to be determined as we implement more; questions are fair game too.\r\n\r\nI held back on subdividing the main Raft module into a nonblocking goroutine and blocking helpers, but it's something we could consider. I haven't studied the code enough to know whether that'd be feasible or advantageous.\r\n\r\nThe transition from here to there is going to take significant effort. Here are a few of the major differences:\r\n - Peer is structured completely differently from replication.go today.\r\n - Peer handles all communication including RequestVote, not just AppendEntries/InstallSnapshot as replication.go does today.\r\n - Fewer locks and shared state. commitment.go and raftstate.go remove locking/atomics, possibly merge into raft.go. Other goroutines don't get a handle to the Raft module's state.\r\n - Snapshots are created through a different flow.\r\n\r\nI started on the replication.go/peer.go changes, but it was before I had a good idea of where things were heading. I'll be happy to pick that up again later.\r\n\r\n/cc @superfell @cstlee @bmizerany @kr @slackpad @sean- hashicorp/raft#84","created_at":"2016-07-12T01:02:39Z","updated_at":"2016-08-09T04:18:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2652b7f860bd9c9f2a0b06c6932fad8b7e5e08db","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/hashicorp/raft/pulls/136/commits","review_comments_url":"https://api.github.com/repos/hashicorp/raft/pulls/136/comments","review_comment_url":"https://api.github.com/repos/hashicorp/raft/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hashicorp/raft/issues/136/comments","statuses_url":"https://api.github.com/repos/hashicorp/raft/statuses/2fc1608bb9619409daca2f9b460c2263a645d1c1","head":{"label":"ongardie:modules","ref":"modules","sha":"2fc1608bb9619409daca2f9b460c2263a645d1c1","user":{"login":"ongardie","id":463856,"avatar_url":"https://avatars.githubusercontent.com/u/463856?v=3","gravatar_id":"","url":"https://api.github.com/users/ongardie","html_url":"https://github.com/ongardie","followers_url":"https://api.github.com/users/ongardie/followers","following_url":"https://api.github.com/users/ongardie/following{/other_user}","gists_url":"https://api.github.com/users/ongardie/gists{/gist_id}","starred_url":"https://api.github.com/users/ongardie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ongardie/subscriptions","organizations_url":"https://api.github.com/users/ongardie/orgs","repos_url":"https://api.github.com/users/ongardie/repos","events_url":"https://api.github.com/users/ongardie/events{/privacy}","received_events_url":"https://api.github.com/users/ongardie/received_events","type":"User","site_admin":false},"repo":{"id":52042953,"name":"hashicorp-raft","full_name":"ongardie/hashicorp-raft","owner":{"login":"ongardie","id":463856,"avatar_url":"https://avatars.githubusercontent.com/u/463856?v=3","gravatar_id":"","url":"https://api.github.com/users/ongardie","html_url":"https://github.com/ongardie","followers_url":"https://api.github.com/users/ongardie/followers","following_url":"https://api.github.com/users/ongardie/following{/other_user}","gists_url":"https://api.github.com/users/ongardie/gists{/gist_id}","starred_url":"https://api.github.com/users/ongardie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ongardie/subscriptions","organizations_url":"https://api.github.com/users/ongardie/orgs","repos_url":"https://api.github.com/users/ongardie/repos","events_url":"https://api.github.com/users/ongardie/events{/privacy}","received_events_url":"https://api.github.com/users/ongardie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ongardie/hashicorp-raft","description":"Fork of Hashicorp's Golang implementation of the Raft consensus protocol","fork":true,"url":"https://api.github.com/repos/ongardie/hashicorp-raft","forks_url":"https://api.github.com/repos/ongardie/hashicorp-raft/forks","keys_url":"https://api.github.com/repos/ongardie/hashicorp-raft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ongardie/hashicorp-raft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ongardie/hashicorp-raft/teams","hooks_url":"https://api.github.com/repos/ongardie/hashicorp-raft/hooks","issue_events_url":"https://api.github.com/repos/ongardie/hashicorp-raft/issues/events{/number}","events_url":"https://api.github.com/repos/ongardie/hashicorp-raft/events","assignees_url":"https://api.github.com/repos/ongardie/hashicorp-raft/assignees{/user}","branches_url":"https://api.github.com/repos/ongardie/hashicorp-raft/branches{/branch}","tags_url":"https://api.github.com/repos/ongardie/hashicorp-raft/tags","blobs_url":"https://api.github.com/repos/ongardie/hashicorp-raft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ongardie/hashicorp-raft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ongardie/hashicorp-raft/git/refs{/sha}","trees_url":"https://api.github.com/repos/ongardie/hashicorp-raft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ongardie/hashicorp-raft/statuses/{sha}","languages_url":"https://api.github.com/repos/ongardie/hashicorp-raft/languages","stargazers_url":"https://api.github.com/repos/ongardie/hashicorp-raft/stargazers","contributors_url":"https://api.github.com/repos/ongardie/hashicorp-raft/contributors","subscribers_url":"https://api.github.com/repos/ongardie/hashicorp-raft/subscribers","subscription_url":"https://api.github.com/repos/ongardie/hashicorp-raft/subscription","commits_url":"https://api.github.com/repos/ongardie/hashicorp-raft/commits{/sha}","git_commits_url":"https://api.github.com/repos/ongardie/hashicorp-raft/git/commits{/sha}","comments_url":"https://api.github.com/repos/ongardie/hashicorp-raft/comments{/number}","issue_comment_url":"https://api.github.com/repos/ongardie/hashicorp-raft/issues/comments{/number}","contents_url":"https://api.github.com/repos/ongardie/hashicorp-raft/contents/{+path}","compare_url":"https://api.github.com/repos/ongardie/hashicorp-raft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ongardie/hashicorp-raft/merges","archive_url":"https://api.github.com/repos/ongardie/hashicorp-raft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ongardie/hashicorp-raft/downloads","issues_url":"https://api.github.com/repos/ongardie/hashicorp-raft/issues{/number}","pulls_url":"https://api.github.com/repos/ongardie/hashicorp-raft/pulls{/number}","milestones_url":"https://api.github.com/repos/ongardie/hashicorp-raft/milestones{/number}","notifications_url":"https://api.github.com/repos/ongardie/hashicorp-raft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ongardie/hashicorp-raft/labels{/name}","releases_url":"https://api.github.com/repos/ongardie/hashicorp-raft/releases{/id}","deployments_url":"https://api.github.com/repos/ongardie/hashicorp-raft/deployments","created_at":"2016-02-18T22:17:50Z","updated_at":"2016-03-20T23:31:26Z","pushed_at":"2016-08-05T21:51:22Z","git_url":"git://github.com/ongardie/hashicorp-raft.git","ssh_url":"git@github.com:ongardie/hashicorp-raft.git","clone_url":"https://github.com/ongardie/hashicorp-raft.git","svn_url":"https://github.com/ongardie/hashicorp-raft","homepage":"","size":1275,"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":"hashicorp:issue-84-integration","ref":"issue-84-integration","sha":"f8ec0064e3a4c44dea136782cb3a66c7c6588855","user":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars.githubusercontent.com/u/761456?v=3","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"repo":{"id":14128006,"name":"raft","full_name":"hashicorp/raft","owner":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars.githubusercontent.com/u/761456?v=3","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hashicorp/raft","description":"Golang implementation of the Raft consensus protocol","fork":false,"url":"https://api.github.com/repos/hashicorp/raft","forks_url":"https://api.github.com/repos/hashicorp/raft/forks","keys_url":"https://api.github.com/repos/hashicorp/raft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hashicorp/raft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hashicorp/raft/teams","hooks_url":"https://api.github.com/repos/hashicorp/raft/hooks","issue_events_url":"https://api.github.com/repos/hashicorp/raft/issues/events{/number}","events_url":"https://api.github.com/repos/hashicorp/raft/events","assignees_url":"https://api.github.com/repos/hashicorp/raft/assignees{/user}","branches_url":"https://api.github.com/repos/hashicorp/raft/branches{/branch}","tags_url":"https://api.github.com/repos/hashicorp/raft/tags","blobs_url":"https://api.github.com/repos/hashicorp/raft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hashicorp/raft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hashicorp/raft/git/refs{/sha}","trees_url":"https://api.github.com/repos/hashicorp/raft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hashicorp/raft/statuses/{sha}","languages_url":"https://api.github.com/repos/hashicorp/raft/languages","stargazers_url":"https://api.github.com/repos/hashicorp/raft/stargazers","contributors_url":"https://api.github.com/repos/hashicorp/raft/contributors","subscribers_url":"https://api.github.com/repos/hashicorp/raft/subscribers","subscription_url":"https://api.github.com/repos/hashicorp/raft/subscription","commits_url":"https://api.github.com/repos/hashicorp/raft/commits{/sha}","git_commits_url":"https://api.github.com/repos/hashicorp/raft/git/commits{/sha}","comments_url":"https://api.github.com/repos/hashicorp/raft/comments{/number}","issue_comment_url":"https://api.github.com/repos/hashicorp/raft/issues/comments{/number}","contents_url":"https://api.github.com/repos/hashicorp/raft/contents/{+path}","compare_url":"https://api.github.com/repos/hashicorp/raft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hashicorp/raft/merges","archive_url":"https://api.github.com/repos/hashicorp/raft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hashicorp/raft/downloads","issues_url":"https://api.github.com/repos/hashicorp/raft/issues{/number}","pulls_url":"https://api.github.com/repos/hashicorp/raft/pulls{/number}","milestones_url":"https://api.github.com/repos/hashicorp/raft/milestones{/number}","notifications_url":"https://api.github.com/repos/hashicorp/raft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hashicorp/raft/labels{/name}","releases_url":"https://api.github.com/repos/hashicorp/raft/releases{/id}","deployments_url":"https://api.github.com/repos/hashicorp/raft/deployments","created_at":"2013-11-05T00:41:20Z","updated_at":"2016-08-08T12:26:15Z","pushed_at":"2016-08-05T21:51:23Z","git_url":"git://github.com/hashicorp/raft.git","ssh_url":"git@github.com:hashicorp/raft.git","clone_url":"https://github.com/hashicorp/raft.git","svn_url":"https://github.com/hashicorp/raft","homepage":null,"size":1466,"stargazers_count":728,"watchers_count":728,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":104,"mirror_url":null,"open_issues_count":31,"forks":104,"open_issues":31,"watchers":728,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hashicorp/raft/pulls/136"},"html":{"href":"https://github.com/hashicorp/raft/pull/136"},"issue":{"href":"https://api.github.com/repos/hashicorp/raft/issues/136"},"comments":{"href":"https://api.github.com/repos/hashicorp/raft/issues/136/comments"},"review_comments":{"href":"https://api.github.com/repos/hashicorp/raft/pulls/136/comments"},"review_comment":{"href":"https://api.github.com/repos/hashicorp/raft/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hashicorp/raft/pulls/136/commits"},"statuses":{"href":"https://api.github.com/repos/hashicorp/raft/statuses/2fc1608bb9619409daca2f9b460c2263a645d1c1"}}}}
{"actor":{"display_login":"superfell"}}