{"action":"created","comment":{"url":"https://api.github.com/repos/keybase/kbfs/pulls/comments/81065734","pull_request_review_id":2072795,"id":81065734,"diff_hunk":"@@ -179,11 +124,121 @@ func (b *BlockServerRemote) ShouldRetry(rpcName string, err error) bool {\n }\n \n // ShouldRetryOnConnect implements the ConnectionHandler interface.\n-func (b *BlockServerRemote) ShouldRetryOnConnect(err error) bool {\n+func (b *blockServerRemoteClientHandler) ShouldRetryOnConnect(err error) bool {\n \t_, inputCanceled := err.(libkb.InputCanceledError)\n \treturn !inputCanceled\n }\n \n+var _ rpc.ConnectionHandler = (*blockServerRemoteClientHandler)(nil)\n+\n+// NewBlockServerRemote constructs a new BlockServerRemote for the\n+// given address.\n+func NewBlockServerRemote(config Config, blkSrvAddr string, ctx Context) *BlockServerRemote {\n+\tlog := config.MakeLogger(\"BSR\")\n+\tdeferLog := log.CloneWithAddedDepth(1)\n+\tbs := &BlockServerRemote{\n+\t\tconfig:     config,\n+\t\tlog:        log,\n+\t\tdeferLog:   deferLog,\n+\t\tblkSrvAddr: blkSrvAddr,\n+\t}\n+\tbs.log.Debug(\"new instance server addr %s\", blkSrvAddr)\n+\n+\t// Use two separate auth tokens and clients -- one for writes and\n+\t// one for reads.  This allows small reads to avoid getting\n+\t// trapped behind large asynchronous writes.  TODO: use some real\n+\t// network QoS to achieve better prioritization within the actual\n+\t// network.\n+\tputClientHandler := &blockServerRemoteClientHandler{\n+\t\tbs:   bs,\n+\t\tname: \"BlockServerRemotePut\",\n+\t}\n+\tbs.putAuthToken = NewAuthToken(config,","path":"libkbfs/bserver_remote.go","position":200,"original_position":200,"commit_id":"00d153876586c01f27b21105fd56dd954c69fbd3","original_commit_id":"00d153876586c01f27b21105fd56dd954c69fbd3","user":{"login":"akalin-keybase","id":13270622,"avatar_url":"https://avatars.githubusercontent.com/u/13270622?v=3","gravatar_id":"","url":"https://api.github.com/users/akalin-keybase","html_url":"https://github.com/akalin-keybase","followers_url":"https://api.github.com/users/akalin-keybase/followers","following_url":"https://api.github.com/users/akalin-keybase/following{/other_user}","gists_url":"https://api.github.com/users/akalin-keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/akalin-keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akalin-keybase/subscriptions","organizations_url":"https://api.github.com/users/akalin-keybase/orgs","repos_url":"https://api.github.com/users/akalin-keybase/repos","events_url":"https://api.github.com/users/akalin-keybase/events{/privacy}","received_events_url":"https://api.github.com/users/akalin-keybase/received_events","type":"User","site_admin":false},"body":"Just verifying -- separate TCP connections need separate auth tokens, i.e. the two connections can't just share one?","created_at":"2016-09-29T05:10:35Z","updated_at":"2016-09-29T05:13:57Z","html_url":"https://github.com/keybase/kbfs/pull/383#discussion_r81065734","pull_request_url":"https://api.github.com/repos/keybase/kbfs/pulls/383","_links":{"self":{"href":"https://api.github.com/repos/keybase/kbfs/pulls/comments/81065734"},"html":{"href":"https://github.com/keybase/kbfs/pull/383#discussion_r81065734"},"pull_request":{"href":"https://api.github.com/repos/keybase/kbfs/pulls/383"}}},"pull_request":{"url":"https://api.github.com/repos/keybase/kbfs/pulls/383","id":87032176,"html_url":"https://github.com/keybase/kbfs/pull/383","diff_url":"https://github.com/keybase/kbfs/pull/383.diff","patch_url":"https://github.com/keybase/kbfs/pull/383.patch","issue_url":"https://api.github.com/repos/keybase/kbfs/issues/383","number":383,"state":"open","locked":false,"title":"bserver_remote: use separate connections for gets and puts","user":{"login":"strib","id":8516691,"avatar_url":"https://avatars.githubusercontent.com/u/8516691?v=3","gravatar_id":"","url":"https://api.github.com/users/strib","html_url":"https://github.com/strib","followers_url":"https://api.github.com/users/strib/followers","following_url":"https://api.github.com/users/strib/following{/other_user}","gists_url":"https://api.github.com/users/strib/gists{/gist_id}","starred_url":"https://api.github.com/users/strib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strib/subscriptions","organizations_url":"https://api.github.com/users/strib/orgs","repos_url":"https://api.github.com/users/strib/repos","events_url":"https://api.github.com/users/strib/events{/privacy}","received_events_url":"https://api.github.com/users/strib/received_events","type":"User","site_admin":false},"body":"Without this, if something is doing a bulk put, a small read could get\r\nblocked behind the slow large block transfers.  With separate TCP\r\nconnections, the read finishes quickly.\r\n\r\nNote that this will double the number of bserver connections, and\r\nincrease the amount of token signing done on the client.  It also\r\nmeans that the bserver must not apply any per-device optimizations\r\nthat assume gets and puts from the same device reach the same bserver\r\n(as far as I know, it makes no such assumptions today).\r\n\r\nIssue: KBFS-1546","created_at":"2016-09-27T23:42:31Z","updated_at":"2016-09-29T05:13:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fcbc8a81ab8d049cd4a04cc3d809d6bfde9e7701","assignee":{"login":"aalness","id":4391003,"avatar_url":"https://avatars.githubusercontent.com/u/4391003?v=3","gravatar_id":"","url":"https://api.github.com/users/aalness","html_url":"https://github.com/aalness","followers_url":"https://api.github.com/users/aalness/followers","following_url":"https://api.github.com/users/aalness/following{/other_user}","gists_url":"https://api.github.com/users/aalness/gists{/gist_id}","starred_url":"https://api.github.com/users/aalness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aalness/subscriptions","organizations_url":"https://api.github.com/users/aalness/orgs","repos_url":"https://api.github.com/users/aalness/repos","events_url":"https://api.github.com/users/aalness/events{/privacy}","received_events_url":"https://api.github.com/users/aalness/received_events","type":"User","site_admin":false},"assignees":[{"login":"aalness","id":4391003,"avatar_url":"https://avatars.githubusercontent.com/u/4391003?v=3","gravatar_id":"","url":"https://api.github.com/users/aalness","html_url":"https://github.com/aalness","followers_url":"https://api.github.com/users/aalness/followers","following_url":"https://api.github.com/users/aalness/following{/other_user}","gists_url":"https://api.github.com/users/aalness/gists{/gist_id}","starred_url":"https://api.github.com/users/aalness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aalness/subscriptions","organizations_url":"https://api.github.com/users/aalness/orgs","repos_url":"https://api.github.com/users/aalness/repos","events_url":"https://api.github.com/users/aalness/events{/privacy}","received_events_url":"https://api.github.com/users/aalness/received_events","type":"User","site_admin":false},{"login":"akalin-keybase","id":13270622,"avatar_url":"https://avatars.githubusercontent.com/u/13270622?v=3","gravatar_id":"","url":"https://api.github.com/users/akalin-keybase","html_url":"https://github.com/akalin-keybase","followers_url":"https://api.github.com/users/akalin-keybase/followers","following_url":"https://api.github.com/users/akalin-keybase/following{/other_user}","gists_url":"https://api.github.com/users/akalin-keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/akalin-keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akalin-keybase/subscriptions","organizations_url":"https://api.github.com/users/akalin-keybase/orgs","repos_url":"https://api.github.com/users/akalin-keybase/repos","events_url":"https://api.github.com/users/akalin-keybase/events{/privacy}","received_events_url":"https://api.github.com/users/akalin-keybase/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/keybase/kbfs/pulls/383/commits","review_comments_url":"https://api.github.com/repos/keybase/kbfs/pulls/383/comments","review_comment_url":"https://api.github.com/repos/keybase/kbfs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/keybase/kbfs/issues/383/comments","statuses_url":"https://api.github.com/repos/keybase/kbfs/statuses/00d153876586c01f27b21105fd56dd954c69fbd3","head":{"label":"keybase:strib/KBFS-1546-bserver-prioritize-reads","ref":"strib/KBFS-1546-bserver-prioritize-reads","sha":"00d153876586c01f27b21105fd56dd954c69fbd3","user":{"login":"keybase","id":5400834,"avatar_url":"https://avatars.githubusercontent.com/u/5400834?v=3","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"repo":{"id":59787605,"name":"kbfs","full_name":"keybase/kbfs","owner":{"login":"keybase","id":5400834,"avatar_url":"https://avatars.githubusercontent.com/u/5400834?v=3","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/keybase/kbfs","description":"Keybase Filesystem (KBFS)","fork":false,"url":"https://api.github.com/repos/keybase/kbfs","forks_url":"https://api.github.com/repos/keybase/kbfs/forks","keys_url":"https://api.github.com/repos/keybase/kbfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keybase/kbfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keybase/kbfs/teams","hooks_url":"https://api.github.com/repos/keybase/kbfs/hooks","issue_events_url":"https://api.github.com/repos/keybase/kbfs/issues/events{/number}","events_url":"https://api.github.com/repos/keybase/kbfs/events","assignees_url":"https://api.github.com/repos/keybase/kbfs/assignees{/user}","branches_url":"https://api.github.com/repos/keybase/kbfs/branches{/branch}","tags_url":"https://api.github.com/repos/keybase/kbfs/tags","blobs_url":"https://api.github.com/repos/keybase/kbfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keybase/kbfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keybase/kbfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/keybase/kbfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keybase/kbfs/statuses/{sha}","languages_url":"https://api.github.com/repos/keybase/kbfs/languages","stargazers_url":"https://api.github.com/repos/keybase/kbfs/stargazers","contributors_url":"https://api.github.com/repos/keybase/kbfs/contributors","subscribers_url":"https://api.github.com/repos/keybase/kbfs/subscribers","subscription_url":"https://api.github.com/repos/keybase/kbfs/subscription","commits_url":"https://api.github.com/repos/keybase/kbfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/keybase/kbfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/keybase/kbfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/keybase/kbfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/keybase/kbfs/contents/{+path}","compare_url":"https://api.github.com/repos/keybase/kbfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keybase/kbfs/merges","archive_url":"https://api.github.com/repos/keybase/kbfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keybase/kbfs/downloads","issues_url":"https://api.github.com/repos/keybase/kbfs/issues{/number}","pulls_url":"https://api.github.com/repos/keybase/kbfs/pulls{/number}","milestones_url":"https://api.github.com/repos/keybase/kbfs/milestones{/number}","notifications_url":"https://api.github.com/repos/keybase/kbfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keybase/kbfs/labels{/name}","releases_url":"https://api.github.com/repos/keybase/kbfs/releases{/id}","deployments_url":"https://api.github.com/repos/keybase/kbfs/deployments","created_at":"2016-05-26T22:37:42Z","updated_at":"2016-09-28T01:57:55Z","pushed_at":"2016-09-29T00:16:31Z","git_url":"git://github.com/keybase/kbfs.git","ssh_url":"git@github.com:keybase/kbfs.git","clone_url":"https://github.com/keybase/kbfs.git","svn_url":"https://github.com/keybase/kbfs","homepage":"https://keybase.io/docs/kbfs","size":34896,"stargazers_count":193,"watchers_count":193,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":22,"forks":19,"open_issues":22,"watchers":193,"default_branch":"master"}},"base":{"label":"keybase:master","ref":"master","sha":"fdb5c0232a395b872dbd24d6e2b56e8f7c61eaca","user":{"login":"keybase","id":5400834,"avatar_url":"https://avatars.githubusercontent.com/u/5400834?v=3","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"repo":{"id":59787605,"name":"kbfs","full_name":"keybase/kbfs","owner":{"login":"keybase","id":5400834,"avatar_url":"https://avatars.githubusercontent.com/u/5400834?v=3","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/keybase/kbfs","description":"Keybase Filesystem (KBFS)","fork":false,"url":"https://api.github.com/repos/keybase/kbfs","forks_url":"https://api.github.com/repos/keybase/kbfs/forks","keys_url":"https://api.github.com/repos/keybase/kbfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keybase/kbfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keybase/kbfs/teams","hooks_url":"https://api.github.com/repos/keybase/kbfs/hooks","issue_events_url":"https://api.github.com/repos/keybase/kbfs/issues/events{/number}","events_url":"https://api.github.com/repos/keybase/kbfs/events","assignees_url":"https://api.github.com/repos/keybase/kbfs/assignees{/user}","branches_url":"https://api.github.com/repos/keybase/kbfs/branches{/branch}","tags_url":"https://api.github.com/repos/keybase/kbfs/tags","blobs_url":"https://api.github.com/repos/keybase/kbfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keybase/kbfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keybase/kbfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/keybase/kbfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keybase/kbfs/statuses/{sha}","languages_url":"https://api.github.com/repos/keybase/kbfs/languages","stargazers_url":"https://api.github.com/repos/keybase/kbfs/stargazers","contributors_url":"https://api.github.com/repos/keybase/kbfs/contributors","subscribers_url":"https://api.github.com/repos/keybase/kbfs/subscribers","subscription_url":"https://api.github.com/repos/keybase/kbfs/subscription","commits_url":"https://api.github.com/repos/keybase/kbfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/keybase/kbfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/keybase/kbfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/keybase/kbfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/keybase/kbfs/contents/{+path}","compare_url":"https://api.github.com/repos/keybase/kbfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keybase/kbfs/merges","archive_url":"https://api.github.com/repos/keybase/kbfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keybase/kbfs/downloads","issues_url":"https://api.github.com/repos/keybase/kbfs/issues{/number}","pulls_url":"https://api.github.com/repos/keybase/kbfs/pulls{/number}","milestones_url":"https://api.github.com/repos/keybase/kbfs/milestones{/number}","notifications_url":"https://api.github.com/repos/keybase/kbfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keybase/kbfs/labels{/name}","releases_url":"https://api.github.com/repos/keybase/kbfs/releases{/id}","deployments_url":"https://api.github.com/repos/keybase/kbfs/deployments","created_at":"2016-05-26T22:37:42Z","updated_at":"2016-09-28T01:57:55Z","pushed_at":"2016-09-29T00:16:31Z","git_url":"git://github.com/keybase/kbfs.git","ssh_url":"git@github.com:keybase/kbfs.git","clone_url":"https://github.com/keybase/kbfs.git","svn_url":"https://github.com/keybase/kbfs","homepage":"https://keybase.io/docs/kbfs","size":34896,"stargazers_count":193,"watchers_count":193,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":22,"forks":19,"open_issues":22,"watchers":193,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/keybase/kbfs/pulls/383"},"html":{"href":"https://github.com/keybase/kbfs/pull/383"},"issue":{"href":"https://api.github.com/repos/keybase/kbfs/issues/383"},"comments":{"href":"https://api.github.com/repos/keybase/kbfs/issues/383/comments"},"review_comments":{"href":"https://api.github.com/repos/keybase/kbfs/pulls/383/comments"},"review_comment":{"href":"https://api.github.com/repos/keybase/kbfs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/keybase/kbfs/pulls/383/commits"},"statuses":{"href":"https://api.github.com/repos/keybase/kbfs/statuses/00d153876586c01f27b21105fd56dd954c69fbd3"}}}}
{"actor":{"display_login":"akalin-keybase"}}