{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/664","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/664/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/664/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/664/events","html_url":"https://github.com/cockroachdb/cockroach/pull/664","id":68552817,"number":664,"title":"Fix the retry condition of rpc.Send()","user":{"login":"kkaneda","id":8353550,"avatar_url":"https://avatars.githubusercontent.com/u/8353550?v=3","gravatar_id":"","url":"https://api.github.com/users/kkaneda","html_url":"https://github.com/kkaneda","followers_url":"https://api.github.com/users/kkaneda/followers","following_url":"https://api.github.com/users/kkaneda/following{/other_user}","gists_url":"https://api.github.com/users/kkaneda/gists{/gist_id}","starred_url":"https://api.github.com/users/kkaneda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkaneda/subscriptions","organizations_url":"https://api.github.com/users/kkaneda/orgs","repos_url":"https://api.github.com/users/kkaneda/repos","events_url":"https://api.github.com/users/kkaneda/events{/privacy}","received_events_url":"https://api.github.com/users/kkaneda/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-04-15T02:24:16Z","updated_at":"2015-04-18T01:57:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/664","html_url":"https://github.com/cockroachdb/cockroach/pull/664","diff_url":"https://github.com/cockroachdb/cockroach/pull/664.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/664.patch"},"body":"(I haven't written any test. Will do if this change makes sense.)\r\n\r\nPreviously, canRetry is set to true if `retryableErrors` is bigger than `errors`, which is always false.\r\n\r\n```\r\n   retryableErrors + remainingRPCs > len(clients)\r\n=> retryableErrors + (len(clients) - errors) > len(clients)\r\n=> retryableErrors - errors > 0\r\n=> retryableErrors > errors\r\n```\r\n\r\nThis commit changes the condition to `remainingRPCs + retryableErrors >= opts.N`.\r\n"},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/94113153","html_url":"https://github.com/cockroachdb/cockroach/pull/664#issuecomment-94113153","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/664","id":94113153,"user":{"login":"kkaneda","id":8353550,"avatar_url":"https://avatars.githubusercontent.com/u/8353550?v=3","gravatar_id":"","url":"https://api.github.com/users/kkaneda","html_url":"https://github.com/kkaneda","followers_url":"https://api.github.com/users/kkaneda/followers","following_url":"https://api.github.com/users/kkaneda/following{/other_user}","gists_url":"https://api.github.com/users/kkaneda/gists{/gist_id}","starred_url":"https://api.github.com/users/kkaneda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkaneda/subscriptions","organizations_url":"https://api.github.com/users/kkaneda/orgs","repos_url":"https://api.github.com/users/kkaneda/repos","events_url":"https://api.github.com/users/kkaneda/events{/privacy}","received_events_url":"https://api.github.com/users/kkaneda/received_events","type":"User","site_admin":false},"created_at":"2015-04-18T01:57:57Z","updated_at":"2015-04-18T01:57:57Z","body":"Hmm, it seems the data race happens when `sendOneFn` is called after a test case finishes. Worked around it by copying `test.numErrors` and `test.numRetryableErrors` to local variables."}}