{"action":"created","comment":{"url":"https://api.github.com/repos/grpc/grpc/pulls/comments/64129786","id":64129786,"diff_hunk":"@@ -507,26 +521,37 @@ static void publish_new_rpc(grpc_exec_ctx *exec_ctx, void *arg, bool success) {\n     return;\n   }\n \n-  int request_id = gpr_stack_lockfree_pop(rm->requests);\n-  if (request_id == -1) {\n-    gpr_mu_lock(&server->mu_call);\n-    gpr_mu_lock(&calld->mu_state);\n-    calld->state = PENDING;\n-    gpr_mu_unlock(&calld->mu_state);\n-    if (rm->pending_head == NULL) {\n-      rm->pending_tail = rm->pending_head = calld;\n+  for (size_t i = 0; i < server->cq_count; i++) {\n+    size_t cq_idx = (chand->cq_idx + i) % server->cq_count;\n+    int request_id = gpr_stack_lockfree_pop(rm->requests_per_cq[cq_idx]);\n+    if (request_id == -1) {\n+      continue;\n     } else {\n-      rm->pending_tail->pending_next = calld;\n-      rm->pending_tail = calld;\n+      gpr_log(GPR_DEBUG, \"queue lockfree, retries=%d chose=%d\", i, cq_idx);","path":"src/core/lib/surface/server.c","position":182,"original_position":182,"commit_id":"ae09d9dca9ac0f6d6c6e877e2935ad8cfba9da05","original_commit_id":"ae09d9dca9ac0f6d6c6e877e2935ad8cfba9da05","user":{"login":"sreecha","id":2754995,"avatar_url":"https://avatars.githubusercontent.com/u/2754995?v=3","gravatar_id":"","url":"https://api.github.com/users/sreecha","html_url":"https://github.com/sreecha","followers_url":"https://api.github.com/users/sreecha/followers","following_url":"https://api.github.com/users/sreecha/following{/other_user}","gists_url":"https://api.github.com/users/sreecha/gists{/gist_id}","starred_url":"https://api.github.com/users/sreecha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sreecha/subscriptions","organizations_url":"https://api.github.com/users/sreecha/orgs","repos_url":"https://api.github.com/users/sreecha/repos","events_url":"https://api.github.com/users/sreecha/events{/privacy}","received_events_url":"https://api.github.com/users/sreecha/received_events","type":"User","site_admin":false},"body":"Delete the debug log here (and at lines 542, 1304, 1311, 1333, 1387 and 1402)","created_at":"2016-05-21T06:35:54Z","updated_at":"2016-05-21T06:35:54Z","html_url":"https://github.com/grpc/grpc/pull/6612#discussion_r64129786","pull_request_url":"https://api.github.com/repos/grpc/grpc/pulls/6612","_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc/pulls/comments/64129786"},"html":{"href":"https://github.com/grpc/grpc/pull/6612#discussion_r64129786"},"pull_request":{"href":"https://api.github.com/repos/grpc/grpc/pulls/6612"}}},"pull_request":{"url":"https://api.github.com/repos/grpc/grpc/pulls/6612","id":70282913,"html_url":"https://github.com/grpc/grpc/pull/6612","diff_url":"https://github.com/grpc/grpc/pull/6612.diff","patch_url":"https://github.com/grpc/grpc/pull/6612.patch","issue_url":"https://api.github.com/repos/grpc/grpc/issues/6612","number":6612,"state":"open","locked":false,"title":"Affinitize server call notification","user":{"login":"ctiller","id":10120821,"avatar_url":"https://avatars.githubusercontent.com/u/10120821?v=3","gravatar_id":"","url":"https://api.github.com/users/ctiller","html_url":"https://github.com/ctiller","followers_url":"https://api.github.com/users/ctiller/followers","following_url":"https://api.github.com/users/ctiller/following{/other_user}","gists_url":"https://api.github.com/users/ctiller/gists{/gist_id}","starred_url":"https://api.github.com/users/ctiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctiller/subscriptions","organizations_url":"https://api.github.com/users/ctiller/orgs","repos_url":"https://api.github.com/users/ctiller/repos","events_url":"https://api.github.com/users/ctiller/events{/privacy}","received_events_url":"https://api.github.com/users/ctiller/received_events","type":"User","site_admin":false},"body":"Takes #6149 and extends it to also keep call request queue affinity with the underlying channel.\r\n\r\nImproves throughput benchmarks somewhere between 20-90% (finally we see the benefit from the initial work!)\r\n\r\nSome refactoring left to get tests building, and no doubt some bugs left.\r\n\r\nAlso built on #6603, #6585","created_at":"2016-05-17T00:23:58Z","updated_at":"2016-05-21T06:35:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ef4466bae991286a6e1d3571375de46fa4161e80","assignee":{"login":"sreecha","id":2754995,"avatar_url":"https://avatars.githubusercontent.com/u/2754995?v=3","gravatar_id":"","url":"https://api.github.com/users/sreecha","html_url":"https://github.com/sreecha","followers_url":"https://api.github.com/users/sreecha/followers","following_url":"https://api.github.com/users/sreecha/following{/other_user}","gists_url":"https://api.github.com/users/sreecha/gists{/gist_id}","starred_url":"https://api.github.com/users/sreecha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sreecha/subscriptions","organizations_url":"https://api.github.com/users/sreecha/orgs","repos_url":"https://api.github.com/users/sreecha/repos","events_url":"https://api.github.com/users/sreecha/events{/privacy}","received_events_url":"https://api.github.com/users/sreecha/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/grpc/grpc/pulls/6612/commits","review_comments_url":"https://api.github.com/repos/grpc/grpc/pulls/6612/comments","review_comment_url":"https://api.github.com/repos/grpc/grpc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/grpc/grpc/issues/6612/comments","statuses_url":"https://api.github.com/repos/grpc/grpc/statuses/ae09d9dca9ac0f6d6c6e877e2935ad8cfba9da05","head":{"label":"ctiller:test_affine","ref":"test_affine","sha":"ae09d9dca9ac0f6d6c6e877e2935ad8cfba9da05","user":{"login":"ctiller","id":10120821,"avatar_url":"https://avatars.githubusercontent.com/u/10120821?v=3","gravatar_id":"","url":"https://api.github.com/users/ctiller","html_url":"https://github.com/ctiller","followers_url":"https://api.github.com/users/ctiller/followers","following_url":"https://api.github.com/users/ctiller/following{/other_user}","gists_url":"https://api.github.com/users/ctiller/gists{/gist_id}","starred_url":"https://api.github.com/users/ctiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctiller/subscriptions","organizations_url":"https://api.github.com/users/ctiller/orgs","repos_url":"https://api.github.com/users/ctiller/repos","events_url":"https://api.github.com/users/ctiller/events{/privacy}","received_events_url":"https://api.github.com/users/ctiller/received_events","type":"User","site_admin":false},"repo":{"id":31379631,"name":"grpc","full_name":"ctiller/grpc","owner":{"login":"ctiller","id":10120821,"avatar_url":"https://avatars.githubusercontent.com/u/10120821?v=3","gravatar_id":"","url":"https://api.github.com/users/ctiller","html_url":"https://github.com/ctiller","followers_url":"https://api.github.com/users/ctiller/followers","following_url":"https://api.github.com/users/ctiller/following{/other_user}","gists_url":"https://api.github.com/users/ctiller/gists{/gist_id}","starred_url":"https://api.github.com/users/ctiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctiller/subscriptions","organizations_url":"https://api.github.com/users/ctiller/orgs","repos_url":"https://api.github.com/users/ctiller/repos","events_url":"https://api.github.com/users/ctiller/events{/privacy}","received_events_url":"https://api.github.com/users/ctiller/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ctiller/grpc","description":"The C based gRPC (C++, Node.js, Python, Ruby, Objective-C, PHP, C#)","fork":true,"url":"https://api.github.com/repos/ctiller/grpc","forks_url":"https://api.github.com/repos/ctiller/grpc/forks","keys_url":"https://api.github.com/repos/ctiller/grpc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ctiller/grpc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ctiller/grpc/teams","hooks_url":"https://api.github.com/repos/ctiller/grpc/hooks","issue_events_url":"https://api.github.com/repos/ctiller/grpc/issues/events{/number}","events_url":"https://api.github.com/repos/ctiller/grpc/events","assignees_url":"https://api.github.com/repos/ctiller/grpc/assignees{/user}","branches_url":"https://api.github.com/repos/ctiller/grpc/branches{/branch}","tags_url":"https://api.github.com/repos/ctiller/grpc/tags","blobs_url":"https://api.github.com/repos/ctiller/grpc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ctiller/grpc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ctiller/grpc/git/refs{/sha}","trees_url":"https://api.github.com/repos/ctiller/grpc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ctiller/grpc/statuses/{sha}","languages_url":"https://api.github.com/repos/ctiller/grpc/languages","stargazers_url":"https://api.github.com/repos/ctiller/grpc/stargazers","contributors_url":"https://api.github.com/repos/ctiller/grpc/contributors","subscribers_url":"https://api.github.com/repos/ctiller/grpc/subscribers","subscription_url":"https://api.github.com/repos/ctiller/grpc/subscription","commits_url":"https://api.github.com/repos/ctiller/grpc/commits{/sha}","git_commits_url":"https://api.github.com/repos/ctiller/grpc/git/commits{/sha}","comments_url":"https://api.github.com/repos/ctiller/grpc/comments{/number}","issue_comment_url":"https://api.github.com/repos/ctiller/grpc/issues/comments{/number}","contents_url":"https://api.github.com/repos/ctiller/grpc/contents/{+path}","compare_url":"https://api.github.com/repos/ctiller/grpc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ctiller/grpc/merges","archive_url":"https://api.github.com/repos/ctiller/grpc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ctiller/grpc/downloads","issues_url":"https://api.github.com/repos/ctiller/grpc/issues{/number}","pulls_url":"https://api.github.com/repos/ctiller/grpc/pulls{/number}","milestones_url":"https://api.github.com/repos/ctiller/grpc/milestones{/number}","notifications_url":"https://api.github.com/repos/ctiller/grpc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ctiller/grpc/labels{/name}","releases_url":"https://api.github.com/repos/ctiller/grpc/releases{/id}","deployments_url":"https://api.github.com/repos/ctiller/grpc/deployments","created_at":"2015-02-26T17:36:22Z","updated_at":"2015-04-20T15:39:22Z","pushed_at":"2016-05-21T05:23:45Z","git_url":"git://github.com/ctiller/grpc.git","ssh_url":"git@github.com:ctiller/grpc.git","clone_url":"https://github.com/ctiller/grpc.git","svn_url":"https://github.com/ctiller/grpc","homepage":"","size":162489,"stargazers_count":2,"watchers_count":2,"language":"C","has_issues":false,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"grpc:master","ref":"master","sha":"3c62c555a4d1b4385d4f8c6c9f533c34c82cec5a","user":{"login":"grpc","id":7802525,"avatar_url":"https://avatars.githubusercontent.com/u/7802525?v=3","gravatar_id":"","url":"https://api.github.com/users/grpc","html_url":"https://github.com/grpc","followers_url":"https://api.github.com/users/grpc/followers","following_url":"https://api.github.com/users/grpc/following{/other_user}","gists_url":"https://api.github.com/users/grpc/gists{/gist_id}","starred_url":"https://api.github.com/users/grpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grpc/subscriptions","organizations_url":"https://api.github.com/users/grpc/orgs","repos_url":"https://api.github.com/users/grpc/repos","events_url":"https://api.github.com/users/grpc/events{/privacy}","received_events_url":"https://api.github.com/users/grpc/received_events","type":"Organization","site_admin":false},"repo":{"id":27729880,"name":"grpc","full_name":"grpc/grpc","owner":{"login":"grpc","id":7802525,"avatar_url":"https://avatars.githubusercontent.com/u/7802525?v=3","gravatar_id":"","url":"https://api.github.com/users/grpc","html_url":"https://github.com/grpc","followers_url":"https://api.github.com/users/grpc/followers","following_url":"https://api.github.com/users/grpc/following{/other_user}","gists_url":"https://api.github.com/users/grpc/gists{/gist_id}","starred_url":"https://api.github.com/users/grpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grpc/subscriptions","organizations_url":"https://api.github.com/users/grpc/orgs","repos_url":"https://api.github.com/users/grpc/repos","events_url":"https://api.github.com/users/grpc/events{/privacy}","received_events_url":"https://api.github.com/users/grpc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/grpc/grpc","description":"The C based gRPC (C++, Node.js, Python, Ruby, Objective-C, PHP, C#)","fork":false,"url":"https://api.github.com/repos/grpc/grpc","forks_url":"https://api.github.com/repos/grpc/grpc/forks","keys_url":"https://api.github.com/repos/grpc/grpc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grpc/grpc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grpc/grpc/teams","hooks_url":"https://api.github.com/repos/grpc/grpc/hooks","issue_events_url":"https://api.github.com/repos/grpc/grpc/issues/events{/number}","events_url":"https://api.github.com/repos/grpc/grpc/events","assignees_url":"https://api.github.com/repos/grpc/grpc/assignees{/user}","branches_url":"https://api.github.com/repos/grpc/grpc/branches{/branch}","tags_url":"https://api.github.com/repos/grpc/grpc/tags","blobs_url":"https://api.github.com/repos/grpc/grpc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grpc/grpc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grpc/grpc/git/refs{/sha}","trees_url":"https://api.github.com/repos/grpc/grpc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grpc/grpc/statuses/{sha}","languages_url":"https://api.github.com/repos/grpc/grpc/languages","stargazers_url":"https://api.github.com/repos/grpc/grpc/stargazers","contributors_url":"https://api.github.com/repos/grpc/grpc/contributors","subscribers_url":"https://api.github.com/repos/grpc/grpc/subscribers","subscription_url":"https://api.github.com/repos/grpc/grpc/subscription","commits_url":"https://api.github.com/repos/grpc/grpc/commits{/sha}","git_commits_url":"https://api.github.com/repos/grpc/grpc/git/commits{/sha}","comments_url":"https://api.github.com/repos/grpc/grpc/comments{/number}","issue_comment_url":"https://api.github.com/repos/grpc/grpc/issues/comments{/number}","contents_url":"https://api.github.com/repos/grpc/grpc/contents/{+path}","compare_url":"https://api.github.com/repos/grpc/grpc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grpc/grpc/merges","archive_url":"https://api.github.com/repos/grpc/grpc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grpc/grpc/downloads","issues_url":"https://api.github.com/repos/grpc/grpc/issues{/number}","pulls_url":"https://api.github.com/repos/grpc/grpc/pulls{/number}","milestones_url":"https://api.github.com/repos/grpc/grpc/milestones{/number}","notifications_url":"https://api.github.com/repos/grpc/grpc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grpc/grpc/labels{/name}","releases_url":"https://api.github.com/repos/grpc/grpc/releases{/id}","deployments_url":"https://api.github.com/repos/grpc/grpc/deployments","created_at":"2014-12-08T18:58:53Z","updated_at":"2016-05-21T03:12:28Z","pushed_at":"2016-05-21T05:23:46Z","git_url":"git://github.com/grpc/grpc.git","ssh_url":"git@github.com:grpc/grpc.git","clone_url":"https://github.com/grpc/grpc.git","svn_url":"https://github.com/grpc/grpc","homepage":"","size":188998,"stargazers_count":5004,"watchers_count":5004,"language":"C","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":916,"mirror_url":null,"open_issues_count":648,"forks":916,"open_issues":648,"watchers":5004,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc/pulls/6612"},"html":{"href":"https://github.com/grpc/grpc/pull/6612"},"issue":{"href":"https://api.github.com/repos/grpc/grpc/issues/6612"},"comments":{"href":"https://api.github.com/repos/grpc/grpc/issues/6612/comments"},"review_comments":{"href":"https://api.github.com/repos/grpc/grpc/pulls/6612/comments"},"review_comment":{"href":"https://api.github.com/repos/grpc/grpc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/grpc/grpc/pulls/6612/commits"},"statuses":{"href":"https://api.github.com/repos/grpc/grpc/statuses/ae09d9dca9ac0f6d6c6e877e2935ad8cfba9da05"}}}}
{"actor":{"display_login":"sreecha"}}