{"action":"created","comment":{"url":"https://api.github.com/repos/projectcalico/libcalico-go/pulls/comments/88976206","pull_request_review_id":9512466,"id":88976206,"diff_hunk":"@@ -28,7 +28,7 @@ import (\n \n var (\n \tmatchIPPool = regexp.MustCompile(\"^/?calico/v1/ipam/v./pool/([^/]+)$\")\n-\ttypeIPPool = reflect.TypeOf(IPPool{})\n+\ttypeIPPool  = reflect.TypeOf(IPPool{})","path":"lib/backend/model/ippool.go","position":5,"original_position":5,"commit_id":"d3ee07c8dc5d36046137fd9dca6c0323ddf6fc5a","original_commit_id":"d3ee07c8dc5d36046137fd9dca6c0323ddf6fc5a","user":{"login":"caseydavenport","id":1944093,"avatar_url":"https://avatars.githubusercontent.com/u/1944093?v=3","gravatar_id":"","url":"https://api.github.com/users/caseydavenport","html_url":"https://github.com/caseydavenport","followers_url":"https://api.github.com/users/caseydavenport/followers","following_url":"https://api.github.com/users/caseydavenport/following{/other_user}","gists_url":"https://api.github.com/users/caseydavenport/gists{/gist_id}","starred_url":"https://api.github.com/users/caseydavenport/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caseydavenport/subscriptions","organizations_url":"https://api.github.com/users/caseydavenport/orgs","repos_url":"https://api.github.com/users/caseydavenport/repos","events_url":"https://api.github.com/users/caseydavenport/events{/privacy}","received_events_url":"https://api.github.com/users/caseydavenport/received_events","type":"User","site_admin":false},"body":"extra space here","created_at":"2016-11-21T20:01:38Z","updated_at":"2016-11-21T20:02:55Z","html_url":"https://github.com/projectcalico/libcalico-go/pull/246#discussion_r88976206","pull_request_url":"https://api.github.com/repos/projectcalico/libcalico-go/pulls/246","_links":{"self":{"href":"https://api.github.com/repos/projectcalico/libcalico-go/pulls/comments/88976206"},"html":{"href":"https://github.com/projectcalico/libcalico-go/pull/246#discussion_r88976206"},"pull_request":{"href":"https://api.github.com/repos/projectcalico/libcalico-go/pulls/246"}}},"pull_request":{"url":"https://api.github.com/repos/projectcalico/libcalico-go/pulls/246","id":92176534,"html_url":"https://github.com/projectcalico/libcalico-go/pull/246","diff_url":"https://github.com/projectcalico/libcalico-go/pull/246.diff","patch_url":"https://github.com/projectcalico/libcalico-go/pull/246.patch","issue_url":"https://api.github.com/repos/projectcalico/libcalico-go/issues/246","number":246,"state":"open","locked":false,"title":"Fix and simplify the etcdv2 Syncer","user":{"login":"fasaxc","id":469264,"avatar_url":"https://avatars.githubusercontent.com/u/469264?v=3","gravatar_id":"","url":"https://api.github.com/users/fasaxc","html_url":"https://github.com/fasaxc","followers_url":"https://api.github.com/users/fasaxc/followers","following_url":"https://api.github.com/users/fasaxc/following{/other_user}","gists_url":"https://api.github.com/users/fasaxc/gists{/gist_id}","starred_url":"https://api.github.com/users/fasaxc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fasaxc/subscriptions","organizations_url":"https://api.github.com/users/fasaxc/orgs","repos_url":"https://api.github.com/users/fasaxc/repos","events_url":"https://api.github.com/users/fasaxc/events{/privacy}","received_events_url":"https://api.github.com/users/fasaxc/received_events","type":"User","site_admin":false},"body":"I found a potential race and a real bug in the etcdv2 Syncer.  This change reworks the Syncer to fix the issue and simplify the snapshot start processing.\r\n\r\nThe bug was that, after the watcher went out-of-sync, it wouldn't start a new snapshot until it received the next event.  Hence, if nothing was going on, you could be out-of-sync indefinitely.  The watcher now explicitly establishes the current etcd index by reading the Ready flag (which has the nice side effect of stalling the watcher until the Ready flag appears).\r\n\r\nThe snapshot initiation logic was based on a dubious triangle of channels and I couldn't convince myself that there wasn't a race lurking in there.  I've simplified that so that the watcher thread tells the merge thread that it needs a new snapshot; then the merge thread sends the message to the snapshot thread.  That way there can't be a race between merge thread being told a snapshot is starting and receiving the first update from the snapshot thread.\r\n\r\nAlong the way, I also cleaned up the channels to use real message types rather than a single struct for everything.  That makes the unpacking code much cleaner.","created_at":"2016-11-03T15:25:14Z","updated_at":"2016-11-21T20:02:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"666b28ae8e9d70e931be1f81cfcc5184180c86b8","assignee":{"login":"robbrockbank","id":3227729,"avatar_url":"https://avatars.githubusercontent.com/u/3227729?v=3","gravatar_id":"","url":"https://api.github.com/users/robbrockbank","html_url":"https://github.com/robbrockbank","followers_url":"https://api.github.com/users/robbrockbank/followers","following_url":"https://api.github.com/users/robbrockbank/following{/other_user}","gists_url":"https://api.github.com/users/robbrockbank/gists{/gist_id}","starred_url":"https://api.github.com/users/robbrockbank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbrockbank/subscriptions","organizations_url":"https://api.github.com/users/robbrockbank/orgs","repos_url":"https://api.github.com/users/robbrockbank/repos","events_url":"https://api.github.com/users/robbrockbank/events{/privacy}","received_events_url":"https://api.github.com/users/robbrockbank/received_events","type":"User","site_admin":false},"assignees":[{"login":"robbrockbank","id":3227729,"avatar_url":"https://avatars.githubusercontent.com/u/3227729?v=3","gravatar_id":"","url":"https://api.github.com/users/robbrockbank","html_url":"https://github.com/robbrockbank","followers_url":"https://api.github.com/users/robbrockbank/followers","following_url":"https://api.github.com/users/robbrockbank/following{/other_user}","gists_url":"https://api.github.com/users/robbrockbank/gists{/gist_id}","starred_url":"https://api.github.com/users/robbrockbank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbrockbank/subscriptions","organizations_url":"https://api.github.com/users/robbrockbank/orgs","repos_url":"https://api.github.com/users/robbrockbank/repos","events_url":"https://api.github.com/users/robbrockbank/events{/privacy}","received_events_url":"https://api.github.com/users/robbrockbank/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/projectcalico/libcalico-go/milestones/2","html_url":"https://github.com/projectcalico/libcalico-go/milestones/v1.0.0","labels_url":"https://api.github.com/repos/projectcalico/libcalico-go/milestones/2/labels","id":1952255,"number":2,"title":"v1.0.0","description":"First GA (non-beta) release of libcalico-go.","creator":{"login":"caseydavenport","id":1944093,"avatar_url":"https://avatars.githubusercontent.com/u/1944093?v=3","gravatar_id":"","url":"https://api.github.com/users/caseydavenport","html_url":"https://github.com/caseydavenport","followers_url":"https://api.github.com/users/caseydavenport/followers","following_url":"https://api.github.com/users/caseydavenport/following{/other_user}","gists_url":"https://api.github.com/users/caseydavenport/gists{/gist_id}","starred_url":"https://api.github.com/users/caseydavenport/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caseydavenport/subscriptions","organizations_url":"https://api.github.com/users/caseydavenport/orgs","repos_url":"https://api.github.com/users/caseydavenport/repos","events_url":"https://api.github.com/users/caseydavenport/events{/privacy}","received_events_url":"https://api.github.com/users/caseydavenport/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":55,"state":"open","created_at":"2016-08-19T20:19:54Z","updated_at":"2016-11-21T18:33:45Z","due_on":"2016-12-09T00:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/projectcalico/libcalico-go/pulls/246/commits","review_comments_url":"https://api.github.com/repos/projectcalico/libcalico-go/pulls/246/comments","review_comment_url":"https://api.github.com/repos/projectcalico/libcalico-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/projectcalico/libcalico-go/issues/246/comments","statuses_url":"https://api.github.com/repos/projectcalico/libcalico-go/statuses/d3ee07c8dc5d36046137fd9dca6c0323ddf6fc5a","head":{"label":"fasaxc:syncer-rework","ref":"syncer-rework","sha":"d3ee07c8dc5d36046137fd9dca6c0323ddf6fc5a","user":{"login":"fasaxc","id":469264,"avatar_url":"https://avatars.githubusercontent.com/u/469264?v=3","gravatar_id":"","url":"https://api.github.com/users/fasaxc","html_url":"https://github.com/fasaxc","followers_url":"https://api.github.com/users/fasaxc/followers","following_url":"https://api.github.com/users/fasaxc/following{/other_user}","gists_url":"https://api.github.com/users/fasaxc/gists{/gist_id}","starred_url":"https://api.github.com/users/fasaxc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fasaxc/subscriptions","organizations_url":"https://api.github.com/users/fasaxc/orgs","repos_url":"https://api.github.com/users/fasaxc/repos","events_url":"https://api.github.com/users/fasaxc/events{/privacy}","received_events_url":"https://api.github.com/users/fasaxc/received_events","type":"User","site_admin":false},"repo":{"id":63591811,"name":"libcalico-go","full_name":"fasaxc/libcalico-go","owner":{"login":"fasaxc","id":469264,"avatar_url":"https://avatars.githubusercontent.com/u/469264?v=3","gravatar_id":"","url":"https://api.github.com/users/fasaxc","html_url":"https://github.com/fasaxc","followers_url":"https://api.github.com/users/fasaxc/followers","following_url":"https://api.github.com/users/fasaxc/following{/other_user}","gists_url":"https://api.github.com/users/fasaxc/gists{/gist_id}","starred_url":"https://api.github.com/users/fasaxc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fasaxc/subscriptions","organizations_url":"https://api.github.com/users/fasaxc/orgs","repos_url":"https://api.github.com/users/fasaxc/repos","events_url":"https://api.github.com/users/fasaxc/events{/privacy}","received_events_url":"https://api.github.com/users/fasaxc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fasaxc/libcalico-go","description":"Golang Calico library functions:  https://www.projectcalico.org","fork":true,"url":"https://api.github.com/repos/fasaxc/libcalico-go","forks_url":"https://api.github.com/repos/fasaxc/libcalico-go/forks","keys_url":"https://api.github.com/repos/fasaxc/libcalico-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fasaxc/libcalico-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fasaxc/libcalico-go/teams","hooks_url":"https://api.github.com/repos/fasaxc/libcalico-go/hooks","issue_events_url":"https://api.github.com/repos/fasaxc/libcalico-go/issues/events{/number}","events_url":"https://api.github.com/repos/fasaxc/libcalico-go/events","assignees_url":"https://api.github.com/repos/fasaxc/libcalico-go/assignees{/user}","branches_url":"https://api.github.com/repos/fasaxc/libcalico-go/branches{/branch}","tags_url":"https://api.github.com/repos/fasaxc/libcalico-go/tags","blobs_url":"https://api.github.com/repos/fasaxc/libcalico-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fasaxc/libcalico-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fasaxc/libcalico-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/fasaxc/libcalico-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fasaxc/libcalico-go/statuses/{sha}","languages_url":"https://api.github.com/repos/fasaxc/libcalico-go/languages","stargazers_url":"https://api.github.com/repos/fasaxc/libcalico-go/stargazers","contributors_url":"https://api.github.com/repos/fasaxc/libcalico-go/contributors","subscribers_url":"https://api.github.com/repos/fasaxc/libcalico-go/subscribers","subscription_url":"https://api.github.com/repos/fasaxc/libcalico-go/subscription","commits_url":"https://api.github.com/repos/fasaxc/libcalico-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/fasaxc/libcalico-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/fasaxc/libcalico-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/fasaxc/libcalico-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/fasaxc/libcalico-go/contents/{+path}","compare_url":"https://api.github.com/repos/fasaxc/libcalico-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fasaxc/libcalico-go/merges","archive_url":"https://api.github.com/repos/fasaxc/libcalico-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fasaxc/libcalico-go/downloads","issues_url":"https://api.github.com/repos/fasaxc/libcalico-go/issues{/number}","pulls_url":"https://api.github.com/repos/fasaxc/libcalico-go/pulls{/number}","milestones_url":"https://api.github.com/repos/fasaxc/libcalico-go/milestones{/number}","notifications_url":"https://api.github.com/repos/fasaxc/libcalico-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fasaxc/libcalico-go/labels{/name}","releases_url":"https://api.github.com/repos/fasaxc/libcalico-go/releases{/id}","deployments_url":"https://api.github.com/repos/fasaxc/libcalico-go/deployments","created_at":"2016-07-18T10:05:33Z","updated_at":"2016-07-18T10:05:35Z","pushed_at":"2016-11-05T18:27:00Z","git_url":"git://github.com/fasaxc/libcalico-go.git","ssh_url":"git@github.com:fasaxc/libcalico-go.git","clone_url":"https://github.com/fasaxc/libcalico-go.git","svn_url":"https://github.com/fasaxc/libcalico-go","homepage":null,"size":663,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"projectcalico:master","ref":"master","sha":"5d335f678e2b3e50541d0dc5ab4f43bad35d0f5b","user":{"login":"projectcalico","id":12304728,"avatar_url":"https://avatars.githubusercontent.com/u/12304728?v=3","gravatar_id":"","url":"https://api.github.com/users/projectcalico","html_url":"https://github.com/projectcalico","followers_url":"https://api.github.com/users/projectcalico/followers","following_url":"https://api.github.com/users/projectcalico/following{/other_user}","gists_url":"https://api.github.com/users/projectcalico/gists{/gist_id}","starred_url":"https://api.github.com/users/projectcalico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectcalico/subscriptions","organizations_url":"https://api.github.com/users/projectcalico/orgs","repos_url":"https://api.github.com/users/projectcalico/repos","events_url":"https://api.github.com/users/projectcalico/events{/privacy}","received_events_url":"https://api.github.com/users/projectcalico/received_events","type":"Organization","site_admin":false},"repo":{"id":63438319,"name":"libcalico-go","full_name":"projectcalico/libcalico-go","owner":{"login":"projectcalico","id":12304728,"avatar_url":"https://avatars.githubusercontent.com/u/12304728?v=3","gravatar_id":"","url":"https://api.github.com/users/projectcalico","html_url":"https://github.com/projectcalico","followers_url":"https://api.github.com/users/projectcalico/followers","following_url":"https://api.github.com/users/projectcalico/following{/other_user}","gists_url":"https://api.github.com/users/projectcalico/gists{/gist_id}","starred_url":"https://api.github.com/users/projectcalico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectcalico/subscriptions","organizations_url":"https://api.github.com/users/projectcalico/orgs","repos_url":"https://api.github.com/users/projectcalico/repos","events_url":"https://api.github.com/users/projectcalico/events{/privacy}","received_events_url":"https://api.github.com/users/projectcalico/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projectcalico/libcalico-go","description":"Golang Calico library functions:  https://www.projectcalico.org","fork":false,"url":"https://api.github.com/repos/projectcalico/libcalico-go","forks_url":"https://api.github.com/repos/projectcalico/libcalico-go/forks","keys_url":"https://api.github.com/repos/projectcalico/libcalico-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectcalico/libcalico-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectcalico/libcalico-go/teams","hooks_url":"https://api.github.com/repos/projectcalico/libcalico-go/hooks","issue_events_url":"https://api.github.com/repos/projectcalico/libcalico-go/issues/events{/number}","events_url":"https://api.github.com/repos/projectcalico/libcalico-go/events","assignees_url":"https://api.github.com/repos/projectcalico/libcalico-go/assignees{/user}","branches_url":"https://api.github.com/repos/projectcalico/libcalico-go/branches{/branch}","tags_url":"https://api.github.com/repos/projectcalico/libcalico-go/tags","blobs_url":"https://api.github.com/repos/projectcalico/libcalico-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectcalico/libcalico-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectcalico/libcalico-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectcalico/libcalico-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectcalico/libcalico-go/statuses/{sha}","languages_url":"https://api.github.com/repos/projectcalico/libcalico-go/languages","stargazers_url":"https://api.github.com/repos/projectcalico/libcalico-go/stargazers","contributors_url":"https://api.github.com/repos/projectcalico/libcalico-go/contributors","subscribers_url":"https://api.github.com/repos/projectcalico/libcalico-go/subscribers","subscription_url":"https://api.github.com/repos/projectcalico/libcalico-go/subscription","commits_url":"https://api.github.com/repos/projectcalico/libcalico-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectcalico/libcalico-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectcalico/libcalico-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectcalico/libcalico-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectcalico/libcalico-go/contents/{+path}","compare_url":"https://api.github.com/repos/projectcalico/libcalico-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectcalico/libcalico-go/merges","archive_url":"https://api.github.com/repos/projectcalico/libcalico-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectcalico/libcalico-go/downloads","issues_url":"https://api.github.com/repos/projectcalico/libcalico-go/issues{/number}","pulls_url":"https://api.github.com/repos/projectcalico/libcalico-go/pulls{/number}","milestones_url":"https://api.github.com/repos/projectcalico/libcalico-go/milestones{/number}","notifications_url":"https://api.github.com/repos/projectcalico/libcalico-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectcalico/libcalico-go/labels{/name}","releases_url":"https://api.github.com/repos/projectcalico/libcalico-go/releases{/id}","deployments_url":"https://api.github.com/repos/projectcalico/libcalico-go/deployments","created_at":"2016-07-15T17:09:40Z","updated_at":"2016-11-13T06:25:00Z","pushed_at":"2016-11-21T18:56:14Z","git_url":"git://github.com/projectcalico/libcalico-go.git","ssh_url":"git@github.com:projectcalico/libcalico-go.git","clone_url":"https://github.com/projectcalico/libcalico-go.git","svn_url":"https://github.com/projectcalico/libcalico-go","homepage":null,"size":1713,"stargazers_count":14,"watchers_count":14,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":27,"forks":15,"open_issues":27,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/projectcalico/libcalico-go/pulls/246"},"html":{"href":"https://github.com/projectcalico/libcalico-go/pull/246"},"issue":{"href":"https://api.github.com/repos/projectcalico/libcalico-go/issues/246"},"comments":{"href":"https://api.github.com/repos/projectcalico/libcalico-go/issues/246/comments"},"review_comments":{"href":"https://api.github.com/repos/projectcalico/libcalico-go/pulls/246/comments"},"review_comment":{"href":"https://api.github.com/repos/projectcalico/libcalico-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/projectcalico/libcalico-go/pulls/246/commits"},"statuses":{"href":"https://api.github.com/repos/projectcalico/libcalico-go/statuses/d3ee07c8dc5d36046137fd9dca6c0323ddf6fc5a"}}}}
{"actor":{"display_login":"caseydavenport"}}