{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/pulls/comments/209747205","pull_request_review_id":145821657,"id":209747205,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwOTc0NzIwNQ==","diff_hunk":"@@ -231,7 +231,13 @@ async Task RenewMessageLockTask(Message message, CancellationToken renewLockCanc\n                 {\n                     var amount = MessagingUtilities.CalculateRenewAfterDuration(message.SystemProperties.LockedUntilUtc);\n                     MessagingEventSource.Log.MessageReceiverPumpRenewMessageStart(this.messageReceiver.ClientId, message, amount);\n-                    await Task.Delay(amount, renewLockCancellationToken).ConfigureAwait(false);\n+                    var delayTask = await Task.Delay(amount, renewLockCancellationToken)\n+                        .ContinueWith(t => t)","path":"src/Microsoft.Azure.ServiceBus/MessageReceivePump.cs","position":null,"original_position":6,"commit_id":"7a6aa239a3e5ff419d86059c89f4bbed0e4bf535","original_commit_id":"7d942c1c5771b518d2c87873aa9a9d2c90578aa7","user":{"login":"SeanFeldman","id":1309622,"node_id":"MDQ6VXNlcjEzMDk2MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/1309622?v=4","gravatar_id":"","url":"https://api.github.com/users/SeanFeldman","html_url":"https://github.com/SeanFeldman","followers_url":"https://api.github.com/users/SeanFeldman/followers","following_url":"https://api.github.com/users/SeanFeldman/following{/other_user}","gists_url":"https://api.github.com/users/SeanFeldman/gists{/gist_id}","starred_url":"https://api.github.com/users/SeanFeldman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeanFeldman/subscriptions","organizations_url":"https://api.github.com/users/SeanFeldman/orgs","repos_url":"https://api.github.com/users/SeanFeldman/repos","events_url":"https://api.github.com/users/SeanFeldman/events{/privacy}","received_events_url":"https://api.github.com/users/SeanFeldman/received_events","type":"User","site_admin":false},"body":"@havarnov see my explanation [here](https://github.com/Azure/azure-service-bus-dotnet/pull/548#discussion_r208731547). I asked a co-worker to review both options and he leaned toward version where he can see that task is kicked off and result is queries later. The challenge with Continuation is that you have to remember that what's awaited is not the first part (`Task.Delay`), but the continuation. Which I suspect is not very natural when you read left to right.","created_at":"2018-08-13T20:27:16Z","updated_at":"2018-08-13T20:27:16Z","html_url":"https://github.com/Azure/azure-service-bus-dotnet/pull/548#discussion_r209747205","pull_request_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/pulls/548","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/pulls/comments/209747205"},"html":{"href":"https://github.com/Azure/azure-service-bus-dotnet/pull/548#discussion_r209747205"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/pulls/548"}},"in_reply_to_id":208479034},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/pulls/548","id":206628404,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2NjI4NDA0","html_url":"https://github.com/Azure/azure-service-bus-dotnet/pull/548","diff_url":"https://github.com/Azure/azure-service-bus-dotnet/pull/548.diff","patch_url":"https://github.com/Azure/azure-service-bus-dotnet/pull/548.patch","issue_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/issues/548","number":548,"state":"open","locked":false,"title":"Gracefully handle cancellation of RenewMessageLockTask","user":{"login":"havarnov","id":222012,"node_id":"MDQ6VXNlcjIyMjAxMg==","avatar_url":"https://avatars0.githubusercontent.com/u/222012?v=4","gravatar_id":"","url":"https://api.github.com/users/havarnov","html_url":"https://github.com/havarnov","followers_url":"https://api.github.com/users/havarnov/followers","following_url":"https://api.github.com/users/havarnov/following{/other_user}","gists_url":"https://api.github.com/users/havarnov/gists{/gist_id}","starred_url":"https://api.github.com/users/havarnov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/havarnov/subscriptions","organizations_url":"https://api.github.com/users/havarnov/orgs","repos_url":"https://api.github.com/users/havarnov/repos","events_url":"https://api.github.com/users/havarnov/events{/privacy}","received_events_url":"https://api.github.com/users/havarnov/received_events","type":"User","site_admin":false},"body":"In the MessageReceivePump class the RenewMessageLockTask is now canceled\r\ngracefully instead of raising an TaskCancelledException and the catch it again.\r\n\r\n[issue](https://github.com/Azure/azure-service-bus-dotnet/issues/547)\r\n\r\n## Description\r\n\r\nThis PR handles cancellation of RenewMessageLockTask  gracefully by awaiting a new task which just pass on the delay task. Then we can check if the delay task was canceled to determine if the lock shall be renewed or not.\r\n","created_at":"2018-08-07T09:05:42Z","updated_at":"2018-08-13T20:27:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"83cca8d668ba4d2430405ab8fbed3d4bfe845037","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/pulls/548/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/pulls/548/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/issues/548/comments","statuses_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/statuses/7a6aa239a3e5ff419d86059c89f4bbed0e4bf535","head":{"label":"havarnov:renewmessagelocktask-cancel-gracefully","ref":"renewmessagelocktask-cancel-gracefully","sha":"7a6aa239a3e5ff419d86059c89f4bbed0e4bf535","user":{"login":"havarnov","id":222012,"node_id":"MDQ6VXNlcjIyMjAxMg==","avatar_url":"https://avatars0.githubusercontent.com/u/222012?v=4","gravatar_id":"","url":"https://api.github.com/users/havarnov","html_url":"https://github.com/havarnov","followers_url":"https://api.github.com/users/havarnov/followers","following_url":"https://api.github.com/users/havarnov/following{/other_user}","gists_url":"https://api.github.com/users/havarnov/gists{/gist_id}","starred_url":"https://api.github.com/users/havarnov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/havarnov/subscriptions","organizations_url":"https://api.github.com/users/havarnov/orgs","repos_url":"https://api.github.com/users/havarnov/repos","events_url":"https://api.github.com/users/havarnov/events{/privacy}","received_events_url":"https://api.github.com/users/havarnov/received_events","type":"User","site_admin":false},"repo":{"id":143845790,"node_id":"MDEwOlJlcG9zaXRvcnkxNDM4NDU3OTA=","name":"azure-service-bus-dotnet","full_name":"havarnov/azure-service-bus-dotnet","owner":{"login":"havarnov","id":222012,"node_id":"MDQ6VXNlcjIyMjAxMg==","avatar_url":"https://avatars0.githubusercontent.com/u/222012?v=4","gravatar_id":"","url":"https://api.github.com/users/havarnov","html_url":"https://github.com/havarnov","followers_url":"https://api.github.com/users/havarnov/followers","following_url":"https://api.github.com/users/havarnov/following{/other_user}","gists_url":"https://api.github.com/users/havarnov/gists{/gist_id}","starred_url":"https://api.github.com/users/havarnov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/havarnov/subscriptions","organizations_url":"https://api.github.com/users/havarnov/orgs","repos_url":"https://api.github.com/users/havarnov/repos","events_url":"https://api.github.com/users/havarnov/events{/privacy}","received_events_url":"https://api.github.com/users/havarnov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/havarnov/azure-service-bus-dotnet","description":"☁️ .NET Standard client library for Azure Service Bus","fork":true,"url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet","forks_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/forks","keys_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/teams","hooks_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/hooks","issue_events_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/issues/events{/number}","events_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/events","assignees_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/assignees{/user}","branches_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/branches{/branch}","tags_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/tags","blobs_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/git/refs{/sha}","trees_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/statuses/{sha}","languages_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/languages","stargazers_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/stargazers","contributors_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/contributors","subscribers_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/subscribers","subscription_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/subscription","commits_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/commits{/sha}","git_commits_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/git/commits{/sha}","comments_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/comments{/number}","issue_comment_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/issues/comments{/number}","contents_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/contents/{+path}","compare_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/merges","archive_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/downloads","issues_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/issues{/number}","pulls_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/pulls{/number}","milestones_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/milestones{/number}","notifications_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/labels{/name}","releases_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/releases{/id}","deployments_url":"https://api.github.com/repos/havarnov/azure-service-bus-dotnet/deployments","created_at":"2018-08-07T08:49:06Z","updated_at":"2018-08-07T08:49:09Z","pushed_at":"2018-08-13T19:56:12Z","git_url":"git://github.com/havarnov/azure-service-bus-dotnet.git","ssh_url":"git@github.com:havarnov/azure-service-bus-dotnet.git","clone_url":"https://github.com/havarnov/azure-service-bus-dotnet.git","svn_url":"https://github.com/havarnov/azure-service-bus-dotnet","homepage":"https://azure.microsoft.com/services/service-bus","size":1542,"stargazers_count":0,"watchers_count":0,"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":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"Azure:dev","ref":"dev","sha":"7fabd8e97bcc9bcdea4cc6e0f96ab3f94e030af3","user":{"login":"Azure","id":6844498,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDQ0OTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":73309503,"node_id":"MDEwOlJlcG9zaXRvcnk3MzMwOTUwMw==","name":"azure-service-bus-dotnet","full_name":"Azure/azure-service-bus-dotnet","owner":{"login":"Azure","id":6844498,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDQ0OTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/azure-service-bus-dotnet","description":"☁️ .NET Standard client library for Azure Service Bus","fork":false,"url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet","forks_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/forks","keys_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/teams","hooks_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/events","assignees_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/tags","blobs_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/subscription","commits_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/merges","archive_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/downloads","issues_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/deployments","created_at":"2016-11-09T18:20:17Z","updated_at":"2018-08-10T02:28:28Z","pushed_at":"2018-08-13T19:56:13Z","git_url":"git://github.com/Azure/azure-service-bus-dotnet.git","ssh_url":"git@github.com:Azure/azure-service-bus-dotnet.git","clone_url":"https://github.com/Azure/azure-service-bus-dotnet.git","svn_url":"https://github.com/Azure/azure-service-bus-dotnet","homepage":"https://azure.microsoft.com/services/service-bus","size":1543,"stargazers_count":191,"watchers_count":191,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":81,"mirror_url":null,"archived":false,"open_issues_count":67,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":81,"open_issues":67,"watchers":191,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/pulls/548"},"html":{"href":"https://github.com/Azure/azure-service-bus-dotnet/pull/548"},"issue":{"href":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/issues/548"},"comments":{"href":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/issues/548/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/pulls/548/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/pulls/548/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-service-bus-dotnet/statuses/7a6aa239a3e5ff419d86059c89f4bbed0e4bf535"}},"author_association":"NONE"}}
{"actor":{"display_login":"SeanFeldman"}}