{"action":"created","comment":{"url":"https://api.github.com/repos/docker/swarmkit/pulls/comments/72536449","id":72536449,"diff_hunk":"@@ -14,46 +15,51 @@ type picker struct {\n \taddr string\n \traft AddrSelector\n \tconn *grpc.Conn\n-\tcc   *grpc.ClientConn\n }\n \n // Init does initial processing for the Picker, e.g., initiate some connections.\n func (p *picker) Init(cc *grpc.ClientConn) error {\n-\tp.cc = cc\n-\treturn nil\n-}\n-\n-func (p *picker) initConn() error {\n-\tif p.conn == nil {\n-\t\tconn, err := grpc.NewConn(p.cc)\n-\t\tif err != nil {\n-\t\t\treturn err\n-\t\t}\n-\t\tp.conn = conn\n+\tconn, err := grpc.NewConn(cc)\n+\tif err != nil {\n+\t\treturn err\n \t}\n+\tp.conn = conn\n \treturn nil\n }\n \n-// Pick blocks until either a transport.ClientTransport is ready for the upcoming RPC\n-// or some error happens.\n-func (p *picker) Pick(ctx context.Context) (transport.ClientTransport, error) {\n-\tp.mu.Lock()\n-\tif err := p.initConn(); err != nil {\n-\t\tp.mu.Unlock()\n-\t\treturn nil, err\n-\t}\n-\tp.mu.Unlock()\n-\n+func (p *picker) updateConn() error {\n \taddr, err := p.raft.LeaderAddr()","path":"manager/raftpicker/raftpicker.go","position":47,"original_position":47,"commit_id":"4c4523346b1ffde4085437d45ac3ea649ce8b1e6","original_commit_id":"4c4523346b1ffde4085437d45ac3ea649ce8b1e6","user":{"login":"stevvooe","id":120601,"avatar_url":"https://avatars.githubusercontent.com/u/120601?v=3","gravatar_id":"","url":"https://api.github.com/users/stevvooe","html_url":"https://github.com/stevvooe","followers_url":"https://api.github.com/users/stevvooe/followers","following_url":"https://api.github.com/users/stevvooe/following{/other_user}","gists_url":"https://api.github.com/users/stevvooe/gists{/gist_id}","starred_url":"https://api.github.com/users/stevvooe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevvooe/subscriptions","organizations_url":"https://api.github.com/users/stevvooe/orgs","repos_url":"https://api.github.com/users/stevvooe/repos","events_url":"https://api.github.com/users/stevvooe/events{/privacy}","received_events_url":"https://api.github.com/users/stevvooe/received_events","type":"User","site_admin":false},"body":"May want to trace it to confirm, but this will cause two addr changes after a call to `PickAddr`.\r\n\r\nMind you, the Picker interface is pure garbage, so I have no clue if that is right or not.","created_at":"2016-07-27T22:30:08Z","updated_at":"2016-07-27T22:30:08Z","html_url":"https://github.com/docker/swarmkit/pull/1251#discussion_r72536449","pull_request_url":"https://api.github.com/repos/docker/swarmkit/pulls/1251","_links":{"self":{"href":"https://api.github.com/repos/docker/swarmkit/pulls/comments/72536449"},"html":{"href":"https://github.com/docker/swarmkit/pull/1251#discussion_r72536449"},"pull_request":{"href":"https://api.github.com/repos/docker/swarmkit/pulls/1251"}}},"pull_request":{"url":"https://api.github.com/repos/docker/swarmkit/pulls/1251","id":79105783,"html_url":"https://github.com/docker/swarmkit/pull/1251","diff_url":"https://github.com/docker/swarmkit/pull/1251.diff","patch_url":"https://github.com/docker/swarmkit/pull/1251.patch","issue_url":"https://api.github.com/repos/docker/swarmkit/issues/1251","number":1251,"state":"open","locked":false,"title":"raftpicker: reset connection if leader addr is changed","user":{"login":"LK4D4","id":101445,"avatar_url":"https://avatars.githubusercontent.com/u/101445?v=3","gravatar_id":"","url":"https://api.github.com/users/LK4D4","html_url":"https://github.com/LK4D4","followers_url":"https://api.github.com/users/LK4D4/followers","following_url":"https://api.github.com/users/LK4D4/following{/other_user}","gists_url":"https://api.github.com/users/LK4D4/gists{/gist_id}","starred_url":"https://api.github.com/users/LK4D4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LK4D4/subscriptions","organizations_url":"https://api.github.com/users/LK4D4/orgs","repos_url":"https://api.github.com/users/LK4D4/repos","events_url":"https://api.github.com/users/LK4D4/events{/privacy}","received_events_url":"https://api.github.com/users/LK4D4/received_events","type":"User","site_admin":false},"body":"ping @aaronlehmann @dongluochen @aluzzardi ","created_at":"2016-07-27T22:02:40Z","updated_at":"2016-07-27T22:30:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d1050b71337ba437935e9b1c70a6fefa20d7c31a","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/docker/swarmkit/milestones/6","html_url":"https://github.com/docker/swarmkit/milestones/1.12.1","labels_url":"https://api.github.com/repos/docker/swarmkit/milestones/6/labels","id":1906142,"number":6,"title":"1.12.1","description":"","creator":{"login":"aluzzardi","id":179503,"avatar_url":"https://avatars.githubusercontent.com/u/179503?v=3","gravatar_id":"","url":"https://api.github.com/users/aluzzardi","html_url":"https://github.com/aluzzardi","followers_url":"https://api.github.com/users/aluzzardi/followers","following_url":"https://api.github.com/users/aluzzardi/following{/other_user}","gists_url":"https://api.github.com/users/aluzzardi/gists{/gist_id}","starred_url":"https://api.github.com/users/aluzzardi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aluzzardi/subscriptions","organizations_url":"https://api.github.com/users/aluzzardi/orgs","repos_url":"https://api.github.com/users/aluzzardi/repos","events_url":"https://api.github.com/users/aluzzardi/events{/privacy}","received_events_url":"https://api.github.com/users/aluzzardi/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":0,"state":"open","created_at":"2016-07-27T00:34:17Z","updated_at":"2016-07-27T22:03:09Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/docker/swarmkit/pulls/1251/commits","review_comments_url":"https://api.github.com/repos/docker/swarmkit/pulls/1251/comments","review_comment_url":"https://api.github.com/repos/docker/swarmkit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/swarmkit/issues/1251/comments","statuses_url":"https://api.github.com/repos/docker/swarmkit/statuses/4c4523346b1ffde4085437d45ac3ea649ce8b1e6","head":{"label":"LK4D4:track_raft_picker","ref":"track_raft_picker","sha":"4c4523346b1ffde4085437d45ac3ea649ce8b1e6","user":{"login":"LK4D4","id":101445,"avatar_url":"https://avatars.githubusercontent.com/u/101445?v=3","gravatar_id":"","url":"https://api.github.com/users/LK4D4","html_url":"https://github.com/LK4D4","followers_url":"https://api.github.com/users/LK4D4/followers","following_url":"https://api.github.com/users/LK4D4/following{/other_user}","gists_url":"https://api.github.com/users/LK4D4/gists{/gist_id}","starred_url":"https://api.github.com/users/LK4D4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LK4D4/subscriptions","organizations_url":"https://api.github.com/users/LK4D4/orgs","repos_url":"https://api.github.com/users/LK4D4/repos","events_url":"https://api.github.com/users/LK4D4/events{/privacy}","received_events_url":"https://api.github.com/users/LK4D4/received_events","type":"User","site_admin":false},"repo":{"id":60712803,"name":"swarmkit","full_name":"LK4D4/swarmkit","owner":{"login":"LK4D4","id":101445,"avatar_url":"https://avatars.githubusercontent.com/u/101445?v=3","gravatar_id":"","url":"https://api.github.com/users/LK4D4","html_url":"https://github.com/LK4D4","followers_url":"https://api.github.com/users/LK4D4/followers","following_url":"https://api.github.com/users/LK4D4/following{/other_user}","gists_url":"https://api.github.com/users/LK4D4/gists{/gist_id}","starred_url":"https://api.github.com/users/LK4D4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LK4D4/subscriptions","organizations_url":"https://api.github.com/users/LK4D4/orgs","repos_url":"https://api.github.com/users/LK4D4/repos","events_url":"https://api.github.com/users/LK4D4/events{/privacy}","received_events_url":"https://api.github.com/users/LK4D4/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/LK4D4/swarmkit","description":"A toolkit for orchestrating distributed systems at any scale. It includes primitives for node discovery, raft-based consensus, task scheduling and more.","fork":true,"url":"https://api.github.com/repos/LK4D4/swarmkit","forks_url":"https://api.github.com/repos/LK4D4/swarmkit/forks","keys_url":"https://api.github.com/repos/LK4D4/swarmkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LK4D4/swarmkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LK4D4/swarmkit/teams","hooks_url":"https://api.github.com/repos/LK4D4/swarmkit/hooks","issue_events_url":"https://api.github.com/repos/LK4D4/swarmkit/issues/events{/number}","events_url":"https://api.github.com/repos/LK4D4/swarmkit/events","assignees_url":"https://api.github.com/repos/LK4D4/swarmkit/assignees{/user}","branches_url":"https://api.github.com/repos/LK4D4/swarmkit/branches{/branch}","tags_url":"https://api.github.com/repos/LK4D4/swarmkit/tags","blobs_url":"https://api.github.com/repos/LK4D4/swarmkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LK4D4/swarmkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LK4D4/swarmkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/LK4D4/swarmkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LK4D4/swarmkit/statuses/{sha}","languages_url":"https://api.github.com/repos/LK4D4/swarmkit/languages","stargazers_url":"https://api.github.com/repos/LK4D4/swarmkit/stargazers","contributors_url":"https://api.github.com/repos/LK4D4/swarmkit/contributors","subscribers_url":"https://api.github.com/repos/LK4D4/swarmkit/subscribers","subscription_url":"https://api.github.com/repos/LK4D4/swarmkit/subscription","commits_url":"https://api.github.com/repos/LK4D4/swarmkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/LK4D4/swarmkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/LK4D4/swarmkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/LK4D4/swarmkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/LK4D4/swarmkit/contents/{+path}","compare_url":"https://api.github.com/repos/LK4D4/swarmkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LK4D4/swarmkit/merges","archive_url":"https://api.github.com/repos/LK4D4/swarmkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LK4D4/swarmkit/downloads","issues_url":"https://api.github.com/repos/LK4D4/swarmkit/issues{/number}","pulls_url":"https://api.github.com/repos/LK4D4/swarmkit/pulls{/number}","milestones_url":"https://api.github.com/repos/LK4D4/swarmkit/milestones{/number}","notifications_url":"https://api.github.com/repos/LK4D4/swarmkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LK4D4/swarmkit/labels{/name}","releases_url":"https://api.github.com/repos/LK4D4/swarmkit/releases{/id}","deployments_url":"https://api.github.com/repos/LK4D4/swarmkit/deployments","created_at":"2016-06-08T16:28:10Z","updated_at":"2016-06-08T16:28:12Z","pushed_at":"2016-07-27T22:02:00Z","git_url":"git://github.com/LK4D4/swarmkit.git","ssh_url":"git@github.com:LK4D4/swarmkit.git","clone_url":"https://github.com/LK4D4/swarmkit.git","svn_url":"https://github.com/LK4D4/swarmkit","homepage":"","size":8498,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"docker:master","ref":"master","sha":"b1c576ce2b63dc78d2d603cb2ee3584069f7dccb","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":51556828,"name":"swarmkit","full_name":"docker/swarmkit","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/swarmkit","description":"A toolkit for orchestrating distributed systems at any scale. It includes primitives for node discovery, raft-based consensus, task scheduling and more.","fork":false,"url":"https://api.github.com/repos/docker/swarmkit","forks_url":"https://api.github.com/repos/docker/swarmkit/forks","keys_url":"https://api.github.com/repos/docker/swarmkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/swarmkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/swarmkit/teams","hooks_url":"https://api.github.com/repos/docker/swarmkit/hooks","issue_events_url":"https://api.github.com/repos/docker/swarmkit/issues/events{/number}","events_url":"https://api.github.com/repos/docker/swarmkit/events","assignees_url":"https://api.github.com/repos/docker/swarmkit/assignees{/user}","branches_url":"https://api.github.com/repos/docker/swarmkit/branches{/branch}","tags_url":"https://api.github.com/repos/docker/swarmkit/tags","blobs_url":"https://api.github.com/repos/docker/swarmkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/swarmkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/swarmkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/swarmkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/swarmkit/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/swarmkit/languages","stargazers_url":"https://api.github.com/repos/docker/swarmkit/stargazers","contributors_url":"https://api.github.com/repos/docker/swarmkit/contributors","subscribers_url":"https://api.github.com/repos/docker/swarmkit/subscribers","subscription_url":"https://api.github.com/repos/docker/swarmkit/subscription","commits_url":"https://api.github.com/repos/docker/swarmkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/swarmkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/swarmkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/swarmkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/swarmkit/contents/{+path}","compare_url":"https://api.github.com/repos/docker/swarmkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/swarmkit/merges","archive_url":"https://api.github.com/repos/docker/swarmkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/swarmkit/downloads","issues_url":"https://api.github.com/repos/docker/swarmkit/issues{/number}","pulls_url":"https://api.github.com/repos/docker/swarmkit/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/swarmkit/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/swarmkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/swarmkit/labels{/name}","releases_url":"https://api.github.com/repos/docker/swarmkit/releases{/id}","deployments_url":"https://api.github.com/repos/docker/swarmkit/deployments","created_at":"2016-02-12T00:02:15Z","updated_at":"2016-07-27T13:38:06Z","pushed_at":"2016-07-27T22:02:40Z","git_url":"git://github.com/docker/swarmkit.git","ssh_url":"git@github.com:docker/swarmkit.git","clone_url":"https://github.com/docker/swarmkit.git","svn_url":"https://github.com/docker/swarmkit","homepage":"","size":18627,"stargazers_count":845,"watchers_count":845,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":141,"mirror_url":null,"open_issues_count":162,"forks":141,"open_issues":162,"watchers":845,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/swarmkit/pulls/1251"},"html":{"href":"https://github.com/docker/swarmkit/pull/1251"},"issue":{"href":"https://api.github.com/repos/docker/swarmkit/issues/1251"},"comments":{"href":"https://api.github.com/repos/docker/swarmkit/issues/1251/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/swarmkit/pulls/1251/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/swarmkit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/swarmkit/pulls/1251/commits"},"statuses":{"href":"https://api.github.com/repos/docker/swarmkit/statuses/4c4523346b1ffde4085437d45ac3ea649ce8b1e6"}}}}
{"actor":{"display_login":"stevvooe"}}