{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/orleans/pulls/comments/176520230","pull_request_review_id":106239216,"id":176520230,"diff_hunk":"@@ -51,9 +51,10 @@ public RoundRobinSelector(ReadOnlyCollection<T> resources)\n         public List<T> NextSelection(int newSelectionCount, List<T> existingSelection)\n         {\n             var selection = new List<T>(newSelectionCount);\n-            while (selection.Count < newSelectionCount)\n+            int tries = 0;\n+            while (selection.Count < newSelectionCount && tries++ < this.resources.Count)\n             {\n-                this.lastSelection = (++this.lastSelection) % (this.resources.Count - 1);\n+                this.lastSelection = (++this.lastSelection) % (this.resources.Count);","path":"src/Orleans.Runtime/Streams/QueueBalancer/LeaseBasedQueueBalancer.cs","position":19,"original_position":19,"commit_id":"11a05936e8757dcf1c793f9b856428e928a5a553","original_commit_id":"77f35c02e40473f9a117cc84ce0d53fe221d9527","user":{"login":"xiazen","id":20803801,"avatar_url":"https://avatars3.githubusercontent.com/u/20803801?v=4","gravatar_id":"","url":"https://api.github.com/users/xiazen","html_url":"https://github.com/xiazen","followers_url":"https://api.github.com/users/xiazen/followers","following_url":"https://api.github.com/users/xiazen/following{/other_user}","gists_url":"https://api.github.com/users/xiazen/gists{/gist_id}","starred_url":"https://api.github.com/users/xiazen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiazen/subscriptions","organizations_url":"https://api.github.com/users/xiazen/orgs","repos_url":"https://api.github.com/users/xiazen/repos","events_url":"https://api.github.com/users/xiazen/events{/privacy}","received_events_url":"https://api.github.com/users/xiazen/received_events","type":"User","site_admin":false},"body":"You are probably right. But can we add some tests testing this. I forgot why I added that minus 1, but I remember I do spent sometime on this. \r\nAdd tests : \r\n- NextSelectionWillGoThroughEveryResourceIfExistingSelectionEmpty\r\n- NextSelectionWontGoInfinitely\r\n- NextSelectionWontReSelectExisitngSelections\r\n","created_at":"2018-03-22T18:07:31Z","updated_at":"2018-03-22T18:07:31Z","html_url":"https://github.com/dotnet/orleans/pull/4267#discussion_r176520230","pull_request_url":"https://api.github.com/repos/dotnet/orleans/pulls/4267","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/comments/176520230"},"html":{"href":"https://github.com/dotnet/orleans/pull/4267#discussion_r176520230"},"pull_request":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/4267"}},"in_reply_to_id":176284594},"pull_request":{"url":"https://api.github.com/repos/dotnet/orleans/pulls/4267","id":176588012,"html_url":"https://github.com/dotnet/orleans/pull/4267","diff_url":"https://github.com/dotnet/orleans/pull/4267.diff","patch_url":"https://github.com/dotnet/orleans/pull/4267.patch","issue_url":"https://api.github.com/repos/dotnet/orleans/issues/4267","number":4267,"state":"open","locked":false,"title":"Lease based queue balancer fixes","user":{"login":"jason-bragg","id":10675494,"avatar_url":"https://avatars2.githubusercontent.com/u/10675494?v=4","gravatar_id":"","url":"https://api.github.com/users/jason-bragg","html_url":"https://github.com/jason-bragg","followers_url":"https://api.github.com/users/jason-bragg/followers","following_url":"https://api.github.com/users/jason-bragg/following{/other_user}","gists_url":"https://api.github.com/users/jason-bragg/gists{/gist_id}","starred_url":"https://api.github.com/users/jason-bragg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jason-bragg/subscriptions","organizations_url":"https://api.github.com/users/jason-bragg/orgs","repos_url":"https://api.github.com/users/jason-bragg/repos","events_url":"https://api.github.com/users/jason-bragg/events{/privacy}","received_events_url":"https://api.github.com/users/jason-bragg/received_events","type":"User","site_admin":false},"body":"- Timers were not on orleans thread so couldn't make grain calls.\r\n- Aqure logic could be too greedy\r\n- logging and spelling cleanup (can you believe -I- fixed spelling?)\r\n- prevented possible devide by 0 issues.","created_at":"2018-03-21T19:37:21Z","updated_at":"2018-03-22T18:07:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e9b6bdabc136777b2e609d8ff3d0b0f54fd72724","assignee":{"login":"xiazen","id":20803801,"avatar_url":"https://avatars3.githubusercontent.com/u/20803801?v=4","gravatar_id":"","url":"https://api.github.com/users/xiazen","html_url":"https://github.com/xiazen","followers_url":"https://api.github.com/users/xiazen/followers","following_url":"https://api.github.com/users/xiazen/following{/other_user}","gists_url":"https://api.github.com/users/xiazen/gists{/gist_id}","starred_url":"https://api.github.com/users/xiazen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiazen/subscriptions","organizations_url":"https://api.github.com/users/xiazen/orgs","repos_url":"https://api.github.com/users/xiazen/repos","events_url":"https://api.github.com/users/xiazen/events{/privacy}","received_events_url":"https://api.github.com/users/xiazen/received_events","type":"User","site_admin":false},"assignees":[{"login":"xiazen","id":20803801,"avatar_url":"https://avatars3.githubusercontent.com/u/20803801?v=4","gravatar_id":"","url":"https://api.github.com/users/xiazen","html_url":"https://github.com/xiazen","followers_url":"https://api.github.com/users/xiazen/followers","following_url":"https://api.github.com/users/xiazen/following{/other_user}","gists_url":"https://api.github.com/users/xiazen/gists{/gist_id}","starred_url":"https://api.github.com/users/xiazen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiazen/subscriptions","organizations_url":"https://api.github.com/users/xiazen/orgs","repos_url":"https://api.github.com/users/xiazen/repos","events_url":"https://api.github.com/users/xiazen/events{/privacy}","received_events_url":"https://api.github.com/users/xiazen/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/dotnet/orleans/milestones/13","html_url":"https://github.com/dotnet/orleans/milestone/13","labels_url":"https://api.github.com/repos/dotnet/orleans/milestones/13/labels","id":1873066,"number":13,"title":"2.0.0","description":"Key target is compatibility with .NET Core.","creator":{"login":"sergeybykov","id":8248806,"avatar_url":"https://avatars1.githubusercontent.com/u/8248806?v=4","gravatar_id":"","url":"https://api.github.com/users/sergeybykov","html_url":"https://github.com/sergeybykov","followers_url":"https://api.github.com/users/sergeybykov/followers","following_url":"https://api.github.com/users/sergeybykov/following{/other_user}","gists_url":"https://api.github.com/users/sergeybykov/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeybykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeybykov/subscriptions","organizations_url":"https://api.github.com/users/sergeybykov/orgs","repos_url":"https://api.github.com/users/sergeybykov/repos","events_url":"https://api.github.com/users/sergeybykov/events{/privacy}","received_events_url":"https://api.github.com/users/sergeybykov/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":222,"state":"open","created_at":"2016-07-08T21:14:40Z","updated_at":"2018-03-22T17:05:29Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/dotnet/orleans/pulls/4267/commits","review_comments_url":"https://api.github.com/repos/dotnet/orleans/pulls/4267/comments","review_comment_url":"https://api.github.com/repos/dotnet/orleans/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/orleans/issues/4267/comments","statuses_url":"https://api.github.com/repos/dotnet/orleans/statuses/11a05936e8757dcf1c793f9b856428e928a5a553","head":{"label":"jason-bragg:LeaseBasedQueueBalancerFixes","ref":"LeaseBasedQueueBalancerFixes","sha":"11a05936e8757dcf1c793f9b856428e928a5a553","user":{"login":"jason-bragg","id":10675494,"avatar_url":"https://avatars2.githubusercontent.com/u/10675494?v=4","gravatar_id":"","url":"https://api.github.com/users/jason-bragg","html_url":"https://github.com/jason-bragg","followers_url":"https://api.github.com/users/jason-bragg/followers","following_url":"https://api.github.com/users/jason-bragg/following{/other_user}","gists_url":"https://api.github.com/users/jason-bragg/gists{/gist_id}","starred_url":"https://api.github.com/users/jason-bragg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jason-bragg/subscriptions","organizations_url":"https://api.github.com/users/jason-bragg/orgs","repos_url":"https://api.github.com/users/jason-bragg/repos","events_url":"https://api.github.com/users/jason-bragg/events{/privacy}","received_events_url":"https://api.github.com/users/jason-bragg/received_events","type":"User","site_admin":false},"repo":{"id":29758989,"name":"orleans","full_name":"jason-bragg/orleans","owner":{"login":"jason-bragg","id":10675494,"avatar_url":"https://avatars2.githubusercontent.com/u/10675494?v=4","gravatar_id":"","url":"https://api.github.com/users/jason-bragg","html_url":"https://github.com/jason-bragg","followers_url":"https://api.github.com/users/jason-bragg/followers","following_url":"https://api.github.com/users/jason-bragg/following{/other_user}","gists_url":"https://api.github.com/users/jason-bragg/gists{/gist_id}","starred_url":"https://api.github.com/users/jason-bragg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jason-bragg/subscriptions","organizations_url":"https://api.github.com/users/jason-bragg/orgs","repos_url":"https://api.github.com/users/jason-bragg/repos","events_url":"https://api.github.com/users/jason-bragg/events{/privacy}","received_events_url":"https://api.github.com/users/jason-bragg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jason-bragg/orleans","description":"Repo for Orleans - Distributed Actor Model","fork":true,"url":"https://api.github.com/repos/jason-bragg/orleans","forks_url":"https://api.github.com/repos/jason-bragg/orleans/forks","keys_url":"https://api.github.com/repos/jason-bragg/orleans/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jason-bragg/orleans/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jason-bragg/orleans/teams","hooks_url":"https://api.github.com/repos/jason-bragg/orleans/hooks","issue_events_url":"https://api.github.com/repos/jason-bragg/orleans/issues/events{/number}","events_url":"https://api.github.com/repos/jason-bragg/orleans/events","assignees_url":"https://api.github.com/repos/jason-bragg/orleans/assignees{/user}","branches_url":"https://api.github.com/repos/jason-bragg/orleans/branches{/branch}","tags_url":"https://api.github.com/repos/jason-bragg/orleans/tags","blobs_url":"https://api.github.com/repos/jason-bragg/orleans/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jason-bragg/orleans/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jason-bragg/orleans/git/refs{/sha}","trees_url":"https://api.github.com/repos/jason-bragg/orleans/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jason-bragg/orleans/statuses/{sha}","languages_url":"https://api.github.com/repos/jason-bragg/orleans/languages","stargazers_url":"https://api.github.com/repos/jason-bragg/orleans/stargazers","contributors_url":"https://api.github.com/repos/jason-bragg/orleans/contributors","subscribers_url":"https://api.github.com/repos/jason-bragg/orleans/subscribers","subscription_url":"https://api.github.com/repos/jason-bragg/orleans/subscription","commits_url":"https://api.github.com/repos/jason-bragg/orleans/commits{/sha}","git_commits_url":"https://api.github.com/repos/jason-bragg/orleans/git/commits{/sha}","comments_url":"https://api.github.com/repos/jason-bragg/orleans/comments{/number}","issue_comment_url":"https://api.github.com/repos/jason-bragg/orleans/issues/comments{/number}","contents_url":"https://api.github.com/repos/jason-bragg/orleans/contents/{+path}","compare_url":"https://api.github.com/repos/jason-bragg/orleans/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jason-bragg/orleans/merges","archive_url":"https://api.github.com/repos/jason-bragg/orleans/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jason-bragg/orleans/downloads","issues_url":"https://api.github.com/repos/jason-bragg/orleans/issues{/number}","pulls_url":"https://api.github.com/repos/jason-bragg/orleans/pulls{/number}","milestones_url":"https://api.github.com/repos/jason-bragg/orleans/milestones{/number}","notifications_url":"https://api.github.com/repos/jason-bragg/orleans/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jason-bragg/orleans/labels{/name}","releases_url":"https://api.github.com/repos/jason-bragg/orleans/releases{/id}","deployments_url":"https://api.github.com/repos/jason-bragg/orleans/deployments","created_at":"2015-01-23T23:54:23Z","updated_at":"2018-03-21T23:38:00Z","pushed_at":"2018-03-22T03:32:11Z","git_url":"git://github.com/jason-bragg/orleans.git","ssh_url":"git@github.com:jason-bragg/orleans.git","clone_url":"https://github.com/jason-bragg/orleans.git","svn_url":"https://github.com/jason-bragg/orleans","homepage":"","size":46024,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"b715a17f413687a346369cbfd142d74a6572fca7","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":28232663,"name":"orleans","full_name":"dotnet/orleans","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/orleans","description":"Orleans - Distributed Virtual Actor Model","fork":false,"url":"https://api.github.com/repos/dotnet/orleans","forks_url":"https://api.github.com/repos/dotnet/orleans/forks","keys_url":"https://api.github.com/repos/dotnet/orleans/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/orleans/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/orleans/teams","hooks_url":"https://api.github.com/repos/dotnet/orleans/hooks","issue_events_url":"https://api.github.com/repos/dotnet/orleans/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/orleans/events","assignees_url":"https://api.github.com/repos/dotnet/orleans/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/orleans/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/orleans/tags","blobs_url":"https://api.github.com/repos/dotnet/orleans/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/orleans/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/orleans/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/orleans/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/orleans/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/orleans/languages","stargazers_url":"https://api.github.com/repos/dotnet/orleans/stargazers","contributors_url":"https://api.github.com/repos/dotnet/orleans/contributors","subscribers_url":"https://api.github.com/repos/dotnet/orleans/subscribers","subscription_url":"https://api.github.com/repos/dotnet/orleans/subscription","commits_url":"https://api.github.com/repos/dotnet/orleans/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/orleans/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/orleans/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/orleans/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/orleans/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/orleans/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/orleans/merges","archive_url":"https://api.github.com/repos/dotnet/orleans/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/orleans/downloads","issues_url":"https://api.github.com/repos/dotnet/orleans/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/orleans/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/orleans/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/orleans/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/orleans/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/orleans/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/orleans/deployments","created_at":"2014-12-19T14:32:50Z","updated_at":"2018-03-22T17:05:35Z","pushed_at":"2018-03-22T17:05:30Z","git_url":"git://github.com/dotnet/orleans.git","ssh_url":"git@github.com:dotnet/orleans.git","clone_url":"https://github.com/dotnet/orleans.git","svn_url":"https://github.com/dotnet/orleans","homepage":"http://dotnet.github.io/orleans","size":46792,"stargazers_count":3672,"watchers_count":3672,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":901,"mirror_url":null,"archived":false,"open_issues_count":341,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":901,"open_issues":341,"watchers":3672,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/4267"},"html":{"href":"https://github.com/dotnet/orleans/pull/4267"},"issue":{"href":"https://api.github.com/repos/dotnet/orleans/issues/4267"},"comments":{"href":"https://api.github.com/repos/dotnet/orleans/issues/4267/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/4267/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/4267/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/orleans/statuses/11a05936e8757dcf1c793f9b856428e928a5a553"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"xiazen"}}