{"action":"closed","number":1185,"pull_request":{"url":"https://api.github.com/repos/dotnet/orleans/pulls/1185","id":54222800,"html_url":"https://github.com/dotnet/orleans/pull/1185","diff_url":"https://github.com/dotnet/orleans/pull/1185.diff","patch_url":"https://github.com/dotnet/orleans/pull/1185.patch","issue_url":"https://api.github.com/repos/dotnet/orleans/issues/1185","number":1185,"state":"closed","locked":false,"title":"Fixed a bug in ReentrentGrainWithState Test, by serializing writes to store from a Reentrant grain.","user":{"login":"gabikliot","id":10171207,"avatar_url":"https://avatars.githubusercontent.com/u/10171207?v=3","gravatar_id":"","url":"https://api.github.com/users/gabikliot","html_url":"https://github.com/gabikliot","followers_url":"https://api.github.com/users/gabikliot/followers","following_url":"https://api.github.com/users/gabikliot/following{/other_user}","gists_url":"https://api.github.com/users/gabikliot/gists{/gist_id}","starred_url":"https://api.github.com/users/gabikliot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabikliot/subscriptions","organizations_url":"https://api.github.com/users/gabikliot/orgs","repos_url":"https://api.github.com/users/gabikliot/repos","events_url":"https://api.github.com/users/gabikliot/events{/privacy}","received_events_url":"https://api.github.com/users/gabikliot/received_events","type":"User","site_admin":false},"body":"ReentrentGrainWithState does a lot of calls to write state async. \r\nOf course, concurrent calls from a **Reentrant** Grain could cause etag violations.\r\nScenario:\r\nImagine Reentrant grain A gets 2 grain calls that want to change and write its state. The previous state, before those 2 calls arrived, had etag 1.\r\nFirst write goes out, with the etag 1.\r\nThe grain code is calling `await`, allowing the 2nd grain call to go in and execute, issuing the 2nd write, still with the etag 1, since write 1 did not finish yet.\r\n\r\nThe bug in this test was not revealed until now, since we had a bug in MemoryStore which did not check etag correctly, which was recently fixed via #1141.\r\nThe fix, in this test and in general in any Reentrant grain with state is **to serialize state writes: never issue more than one write concurrently**.\r\nLuckily, this is very easy to implement with `async` `await`. See the fixed code `PerformSerializedStateUpdate`. No deadlocks are possible.","created_at":"2015-12-21T05:48:59Z","updated_at":"2015-12-21T06:21:31Z","closed_at":"2015-12-21T06:21:31Z","merged_at":"2015-12-21T06:21:31Z","merge_commit_sha":"2b23577b252f23da31319941e7a52da78204b5a1","assignee":{"login":"sergeybykov","id":8248806,"avatar_url":"https://avatars.githubusercontent.com/u/8248806?v=3","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},"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/orleans/pulls/1185/commits","review_comments_url":"https://api.github.com/repos/dotnet/orleans/pulls/1185/comments","review_comment_url":"https://api.github.com/repos/dotnet/orleans/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/orleans/issues/1185/comments","statuses_url":"https://api.github.com/repos/dotnet/orleans/statuses/1c668b80fb8f1d624487bbddf6bf1fabeebb46f1","head":{"label":"gabikliot:ReentrentGrainWithState-Bug","ref":"ReentrentGrainWithState-Bug","sha":"1c668b80fb8f1d624487bbddf6bf1fabeebb46f1","user":{"login":"gabikliot","id":10171207,"avatar_url":"https://avatars.githubusercontent.com/u/10171207?v=3","gravatar_id":"","url":"https://api.github.com/users/gabikliot","html_url":"https://github.com/gabikliot","followers_url":"https://api.github.com/users/gabikliot/followers","following_url":"https://api.github.com/users/gabikliot/following{/other_user}","gists_url":"https://api.github.com/users/gabikliot/gists{/gist_id}","starred_url":"https://api.github.com/users/gabikliot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabikliot/subscriptions","organizations_url":"https://api.github.com/users/gabikliot/orgs","repos_url":"https://api.github.com/users/gabikliot/repos","events_url":"https://api.github.com/users/gabikliot/events{/privacy}","received_events_url":"https://api.github.com/users/gabikliot/received_events","type":"User","site_admin":false},"repo":{"id":32177271,"name":"orleans","full_name":"gabikliot/orleans","owner":{"login":"gabikliot","id":10171207,"avatar_url":"https://avatars.githubusercontent.com/u/10171207?v=3","gravatar_id":"","url":"https://api.github.com/users/gabikliot","html_url":"https://github.com/gabikliot","followers_url":"https://api.github.com/users/gabikliot/followers","following_url":"https://api.github.com/users/gabikliot/following{/other_user}","gists_url":"https://api.github.com/users/gabikliot/gists{/gist_id}","starred_url":"https://api.github.com/users/gabikliot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabikliot/subscriptions","organizations_url":"https://api.github.com/users/gabikliot/orgs","repos_url":"https://api.github.com/users/gabikliot/repos","events_url":"https://api.github.com/users/gabikliot/events{/privacy}","received_events_url":"https://api.github.com/users/gabikliot/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gabikliot/orleans","description":"Repo for Orleans - Distributed Actor Model","fork":true,"url":"https://api.github.com/repos/gabikliot/orleans","forks_url":"https://api.github.com/repos/gabikliot/orleans/forks","keys_url":"https://api.github.com/repos/gabikliot/orleans/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gabikliot/orleans/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gabikliot/orleans/teams","hooks_url":"https://api.github.com/repos/gabikliot/orleans/hooks","issue_events_url":"https://api.github.com/repos/gabikliot/orleans/issues/events{/number}","events_url":"https://api.github.com/repos/gabikliot/orleans/events","assignees_url":"https://api.github.com/repos/gabikliot/orleans/assignees{/user}","branches_url":"https://api.github.com/repos/gabikliot/orleans/branches{/branch}","tags_url":"https://api.github.com/repos/gabikliot/orleans/tags","blobs_url":"https://api.github.com/repos/gabikliot/orleans/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gabikliot/orleans/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gabikliot/orleans/git/refs{/sha}","trees_url":"https://api.github.com/repos/gabikliot/orleans/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gabikliot/orleans/statuses/{sha}","languages_url":"https://api.github.com/repos/gabikliot/orleans/languages","stargazers_url":"https://api.github.com/repos/gabikliot/orleans/stargazers","contributors_url":"https://api.github.com/repos/gabikliot/orleans/contributors","subscribers_url":"https://api.github.com/repos/gabikliot/orleans/subscribers","subscription_url":"https://api.github.com/repos/gabikliot/orleans/subscription","commits_url":"https://api.github.com/repos/gabikliot/orleans/commits{/sha}","git_commits_url":"https://api.github.com/repos/gabikliot/orleans/git/commits{/sha}","comments_url":"https://api.github.com/repos/gabikliot/orleans/comments{/number}","issue_comment_url":"https://api.github.com/repos/gabikliot/orleans/issues/comments{/number}","contents_url":"https://api.github.com/repos/gabikliot/orleans/contents/{+path}","compare_url":"https://api.github.com/repos/gabikliot/orleans/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gabikliot/orleans/merges","archive_url":"https://api.github.com/repos/gabikliot/orleans/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gabikliot/orleans/downloads","issues_url":"https://api.github.com/repos/gabikliot/orleans/issues{/number}","pulls_url":"https://api.github.com/repos/gabikliot/orleans/pulls{/number}","milestones_url":"https://api.github.com/repos/gabikliot/orleans/milestones{/number}","notifications_url":"https://api.github.com/repos/gabikliot/orleans/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gabikliot/orleans/labels{/name}","releases_url":"https://api.github.com/repos/gabikliot/orleans/releases{/id}","created_at":"2015-03-13T19:46:58Z","updated_at":"2015-05-08T18:13:11Z","pushed_at":"2015-12-21T06:15:38Z","git_url":"git://github.com/gabikliot/orleans.git","ssh_url":"git@github.com:gabikliot/orleans.git","clone_url":"https://github.com/gabikliot/orleans.git","svn_url":"https://github.com/gabikliot/orleans","homepage":"https://github.com/dotnet/orleans","size":44110,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"46a0c900e93a006d01e68ffb9dab56285cadce87","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","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://avatars.githubusercontent.com/u/9141961?v=3","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}","created_at":"2014-12-19T14:32:50Z","updated_at":"2015-12-21T05:57:13Z","pushed_at":"2015-12-21T06:21:31Z","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":29361,"stargazers_count":1394,"watchers_count":1394,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":335,"mirror_url":null,"open_issues_count":116,"forks":335,"open_issues":116,"watchers":1394,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/1185"},"html":{"href":"https://github.com/dotnet/orleans/pull/1185"},"issue":{"href":"https://api.github.com/repos/dotnet/orleans/issues/1185"},"comments":{"href":"https://api.github.com/repos/dotnet/orleans/issues/1185/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/1185/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/1185/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/orleans/statuses/1c668b80fb8f1d624487bbddf6bf1fabeebb46f1"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"sergeybykov","id":8248806,"avatar_url":"https://avatars.githubusercontent.com/u/8248806?v=3","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},"comments":1,"review_comments":0,"commits":1,"additions":29,"deletions":10,"changed_files":1}}