{"action":"created","comment":{"url":"https://api.github.com/repos/affandar/durabletask/pulls/comments/27049240","id":27049240,"diff_hunk":"@@ -152,45 +152,45 @@ public sealed class TaskActivityDispatcher : DispatcherBase<BrokeredMessage>\n             }\n         }\n \n+\n+        /// <summary>\n+        /// Ensures that long running tasks are not redispatched if execution takes longer than \n+        /// LockDuration, which is usually 1 minute by default.\n+        /// It would be good to make default renew interval configurable.\n+        /// </summary>\n+        /// <param name=\"message\"></param>\n+        /// <param name=\"cancellationToken\"></param>\n         async void RenewUntil(BrokeredMessage message, CancellationToken cancellationToken)\n         {\n             try\n             {\n-                if (message.LockedUntilUtc < DateTime.UtcNow)\n-                {\n-                    return;\n-                }\n-\n-                DateTime renewAt = message.LockedUntilUtc.Subtract(TimeSpan.FromSeconds(30));\n-\n-                // service bus clock sku can really mess us up so just always renew every 30 secs regardless of \n-                // what the message.LockedUntilUtc says. if the sku is negative then in the worst case we will be\n-                // renewing every 5 secs\n-                //\n-                renewAt = AdjustRenewAt(renewAt);\n+                int renewInterval = 30000;\n \n                 while (!cancellationToken.IsCancellationRequested)\n                 {\n-                    await Task.Delay(TimeSpan.FromSeconds(5));\n-\n-                    if (DateTime.UtcNow >= renewAt)\n+                    await Task.Delay(TimeSpan.FromSeconds(30));","path":"Framework/TaskActivityDispatcher.cs","position":35,"original_position":35,"commit_id":"1387973f31bf4d060df93144bf144e3b03e30c6c","original_commit_id":"1387973f31bf4d060df93144bf144e3b03e30c6c","user":{"login":"affandar","id":1480118,"avatar_url":"https://avatars.githubusercontent.com/u/1480118?v=3","gravatar_id":"","url":"https://api.github.com/users/affandar","html_url":"https://github.com/affandar","followers_url":"https://api.github.com/users/affandar/followers","following_url":"https://api.github.com/users/affandar/following{/other_user}","gists_url":"https://api.github.com/users/affandar/gists{/gist_id}","starred_url":"https://api.github.com/users/affandar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/affandar/subscriptions","organizations_url":"https://api.github.com/users/affandar/orgs","repos_url":"https://api.github.com/users/affandar/repos","events_url":"https://api.github.com/users/affandar/events{/privacy}","received_events_url":"https://api.github.com/users/affandar/received_events","type":"User","site_admin":false},"body":"This should actually use the renewInterval defined above.","created_at":"2015-03-24T17:01:47Z","updated_at":"2015-03-24T17:01:47Z","html_url":"https://github.com/affandar/durabletask/pull/9#discussion_r27049240","pull_request_url":"https://api.github.com/repos/affandar/durabletask/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/affandar/durabletask/pulls/comments/27049240"},"html":{"href":"https://github.com/affandar/durabletask/pull/9#discussion_r27049240"},"pull_request":{"href":"https://api.github.com/repos/affandar/durabletask/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/affandar/durabletask/pulls/9","id":30265297,"html_url":"https://github.com/affandar/durabletask/pull/9","diff_url":"https://github.com/affandar/durabletask/pull/9.diff","patch_url":"https://github.com/affandar/durabletask/pull/9.patch","issue_url":"https://api.github.com/repos/affandar/durabletask/issues/9","number":9,"state":"open","locked":false,"title":"Bug with renewing ot long running tasks fixed","user":{"login":"ddobric","id":1756871,"avatar_url":"https://avatars.githubusercontent.com/u/1756871?v=3","gravatar_id":"","url":"https://api.github.com/users/ddobric","html_url":"https://github.com/ddobric","followers_url":"https://api.github.com/users/ddobric/followers","following_url":"https://api.github.com/users/ddobric/following{/other_user}","gists_url":"https://api.github.com/users/ddobric/gists{/gist_id}","starred_url":"https://api.github.com/users/ddobric/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddobric/subscriptions","organizations_url":"https://api.github.com/users/ddobric/orgs","repos_url":"https://api.github.com/users/ddobric/repos","events_url":"https://api.github.com/users/ddobric/events{/privacy}","received_events_url":"https://api.github.com/users/ddobric/received_events","type":"User","site_admin":false},"body":"Due the issue with SB time precision, this check-in contains a fix, which renews the lock in regular interval of 30 sec. It is recommended to make this interval configurable in dependence of the lock time defined on the entity. ","created_at":"2015-03-02T08:22:08Z","updated_at":"2015-03-24T17:01:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"84103f1ec9bda7c2eb771e495300d4b21710edda","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/affandar/durabletask/pulls/9/commits","review_comments_url":"https://api.github.com/repos/affandar/durabletask/pulls/9/comments","review_comment_url":"https://api.github.com/repos/affandar/durabletask/pulls/comments{/number}","comments_url":"https://api.github.com/repos/affandar/durabletask/issues/9/comments","statuses_url":"https://api.github.com/repos/affandar/durabletask/statuses/1387973f31bf4d060df93144bf144e3b03e30c6c","head":{"label":"ddobric:master","ref":"master","sha":"1387973f31bf4d060df93144bf144e3b03e30c6c","user":{"login":"ddobric","id":1756871,"avatar_url":"https://avatars.githubusercontent.com/u/1756871?v=3","gravatar_id":"","url":"https://api.github.com/users/ddobric","html_url":"https://github.com/ddobric","followers_url":"https://api.github.com/users/ddobric/followers","following_url":"https://api.github.com/users/ddobric/following{/other_user}","gists_url":"https://api.github.com/users/ddobric/gists{/gist_id}","starred_url":"https://api.github.com/users/ddobric/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddobric/subscriptions","organizations_url":"https://api.github.com/users/ddobric/orgs","repos_url":"https://api.github.com/users/ddobric/repos","events_url":"https://api.github.com/users/ddobric/events{/privacy}","received_events_url":"https://api.github.com/users/ddobric/received_events","type":"User","site_admin":false},"repo":{"id":30794464,"name":"durabletask","full_name":"ddobric/durabletask","owner":{"login":"ddobric","id":1756871,"avatar_url":"https://avatars.githubusercontent.com/u/1756871?v=3","gravatar_id":"","url":"https://api.github.com/users/ddobric","html_url":"https://github.com/ddobric","followers_url":"https://api.github.com/users/ddobric/followers","following_url":"https://api.github.com/users/ddobric/following{/other_user}","gists_url":"https://api.github.com/users/ddobric/gists{/gist_id}","starred_url":"https://api.github.com/users/ddobric/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddobric/subscriptions","organizations_url":"https://api.github.com/users/ddobric/orgs","repos_url":"https://api.github.com/users/ddobric/repos","events_url":"https://api.github.com/users/ddobric/events{/privacy}","received_events_url":"https://api.github.com/users/ddobric/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ddobric/durabletask","description":"Durable Task Framework allows users to write long running persistent workflows in C# using the async/await capabilities.","fork":true,"url":"https://api.github.com/repos/ddobric/durabletask","forks_url":"https://api.github.com/repos/ddobric/durabletask/forks","keys_url":"https://api.github.com/repos/ddobric/durabletask/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ddobric/durabletask/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ddobric/durabletask/teams","hooks_url":"https://api.github.com/repos/ddobric/durabletask/hooks","issue_events_url":"https://api.github.com/repos/ddobric/durabletask/issues/events{/number}","events_url":"https://api.github.com/repos/ddobric/durabletask/events","assignees_url":"https://api.github.com/repos/ddobric/durabletask/assignees{/user}","branches_url":"https://api.github.com/repos/ddobric/durabletask/branches{/branch}","tags_url":"https://api.github.com/repos/ddobric/durabletask/tags","blobs_url":"https://api.github.com/repos/ddobric/durabletask/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ddobric/durabletask/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ddobric/durabletask/git/refs{/sha}","trees_url":"https://api.github.com/repos/ddobric/durabletask/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ddobric/durabletask/statuses/{sha}","languages_url":"https://api.github.com/repos/ddobric/durabletask/languages","stargazers_url":"https://api.github.com/repos/ddobric/durabletask/stargazers","contributors_url":"https://api.github.com/repos/ddobric/durabletask/contributors","subscribers_url":"https://api.github.com/repos/ddobric/durabletask/subscribers","subscription_url":"https://api.github.com/repos/ddobric/durabletask/subscription","commits_url":"https://api.github.com/repos/ddobric/durabletask/commits{/sha}","git_commits_url":"https://api.github.com/repos/ddobric/durabletask/git/commits{/sha}","comments_url":"https://api.github.com/repos/ddobric/durabletask/comments{/number}","issue_comment_url":"https://api.github.com/repos/ddobric/durabletask/issues/comments{/number}","contents_url":"https://api.github.com/repos/ddobric/durabletask/contents/{+path}","compare_url":"https://api.github.com/repos/ddobric/durabletask/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ddobric/durabletask/merges","archive_url":"https://api.github.com/repos/ddobric/durabletask/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ddobric/durabletask/downloads","issues_url":"https://api.github.com/repos/ddobric/durabletask/issues{/number}","pulls_url":"https://api.github.com/repos/ddobric/durabletask/pulls{/number}","milestones_url":"https://api.github.com/repos/ddobric/durabletask/milestones{/number}","notifications_url":"https://api.github.com/repos/ddobric/durabletask/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ddobric/durabletask/labels{/name}","releases_url":"https://api.github.com/repos/ddobric/durabletask/releases{/id}","created_at":"2015-02-14T11:12:46Z","updated_at":"2015-03-03T09:03:48Z","pushed_at":"2015-03-03T09:03:48Z","git_url":"git://github.com/ddobric/durabletask.git","ssh_url":"git@github.com:ddobric/durabletask.git","clone_url":"https://github.com/ddobric/durabletask.git","svn_url":"https://github.com/ddobric/durabletask","homepage":null,"size":280,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"affandar:master","ref":"master","sha":"854eea98b824415a3a00fcddd362884144f98970","user":{"login":"affandar","id":1480118,"avatar_url":"https://avatars.githubusercontent.com/u/1480118?v=3","gravatar_id":"","url":"https://api.github.com/users/affandar","html_url":"https://github.com/affandar","followers_url":"https://api.github.com/users/affandar/followers","following_url":"https://api.github.com/users/affandar/following{/other_user}","gists_url":"https://api.github.com/users/affandar/gists{/gist_id}","starred_url":"https://api.github.com/users/affandar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/affandar/subscriptions","organizations_url":"https://api.github.com/users/affandar/orgs","repos_url":"https://api.github.com/users/affandar/repos","events_url":"https://api.github.com/users/affandar/events{/privacy}","received_events_url":"https://api.github.com/users/affandar/received_events","type":"User","site_admin":false},"repo":{"id":24898533,"name":"durabletask","full_name":"affandar/durabletask","owner":{"login":"affandar","id":1480118,"avatar_url":"https://avatars.githubusercontent.com/u/1480118?v=3","gravatar_id":"","url":"https://api.github.com/users/affandar","html_url":"https://github.com/affandar","followers_url":"https://api.github.com/users/affandar/followers","following_url":"https://api.github.com/users/affandar/following{/other_user}","gists_url":"https://api.github.com/users/affandar/gists{/gist_id}","starred_url":"https://api.github.com/users/affandar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/affandar/subscriptions","organizations_url":"https://api.github.com/users/affandar/orgs","repos_url":"https://api.github.com/users/affandar/repos","events_url":"https://api.github.com/users/affandar/events{/privacy}","received_events_url":"https://api.github.com/users/affandar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/affandar/durabletask","description":"Durable Task Framework allows users to write long running persistent workflows in C# using the async/await capabilities.","fork":false,"url":"https://api.github.com/repos/affandar/durabletask","forks_url":"https://api.github.com/repos/affandar/durabletask/forks","keys_url":"https://api.github.com/repos/affandar/durabletask/keys{/key_id}","collaborators_url":"https://api.github.com/repos/affandar/durabletask/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/affandar/durabletask/teams","hooks_url":"https://api.github.com/repos/affandar/durabletask/hooks","issue_events_url":"https://api.github.com/repos/affandar/durabletask/issues/events{/number}","events_url":"https://api.github.com/repos/affandar/durabletask/events","assignees_url":"https://api.github.com/repos/affandar/durabletask/assignees{/user}","branches_url":"https://api.github.com/repos/affandar/durabletask/branches{/branch}","tags_url":"https://api.github.com/repos/affandar/durabletask/tags","blobs_url":"https://api.github.com/repos/affandar/durabletask/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/affandar/durabletask/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/affandar/durabletask/git/refs{/sha}","trees_url":"https://api.github.com/repos/affandar/durabletask/git/trees{/sha}","statuses_url":"https://api.github.com/repos/affandar/durabletask/statuses/{sha}","languages_url":"https://api.github.com/repos/affandar/durabletask/languages","stargazers_url":"https://api.github.com/repos/affandar/durabletask/stargazers","contributors_url":"https://api.github.com/repos/affandar/durabletask/contributors","subscribers_url":"https://api.github.com/repos/affandar/durabletask/subscribers","subscription_url":"https://api.github.com/repos/affandar/durabletask/subscription","commits_url":"https://api.github.com/repos/affandar/durabletask/commits{/sha}","git_commits_url":"https://api.github.com/repos/affandar/durabletask/git/commits{/sha}","comments_url":"https://api.github.com/repos/affandar/durabletask/comments{/number}","issue_comment_url":"https://api.github.com/repos/affandar/durabletask/issues/comments{/number}","contents_url":"https://api.github.com/repos/affandar/durabletask/contents/{+path}","compare_url":"https://api.github.com/repos/affandar/durabletask/compare/{base}...{head}","merges_url":"https://api.github.com/repos/affandar/durabletask/merges","archive_url":"https://api.github.com/repos/affandar/durabletask/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/affandar/durabletask/downloads","issues_url":"https://api.github.com/repos/affandar/durabletask/issues{/number}","pulls_url":"https://api.github.com/repos/affandar/durabletask/pulls{/number}","milestones_url":"https://api.github.com/repos/affandar/durabletask/milestones{/number}","notifications_url":"https://api.github.com/repos/affandar/durabletask/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/affandar/durabletask/labels{/name}","releases_url":"https://api.github.com/repos/affandar/durabletask/releases{/id}","created_at":"2014-10-07T15:58:45Z","updated_at":"2015-03-24T15:23:41Z","pushed_at":"2015-01-30T08:51:18Z","git_url":"git://github.com/affandar/durabletask.git","ssh_url":"git@github.com:affandar/durabletask.git","clone_url":"https://github.com/affandar/durabletask.git","svn_url":"https://github.com/affandar/durabletask","homepage":null,"size":647,"stargazers_count":18,"watchers_count":18,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":9,"forks":7,"open_issues":9,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/affandar/durabletask/pulls/9"},"html":{"href":"https://github.com/affandar/durabletask/pull/9"},"issue":{"href":"https://api.github.com/repos/affandar/durabletask/issues/9"},"comments":{"href":"https://api.github.com/repos/affandar/durabletask/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/affandar/durabletask/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/affandar/durabletask/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/affandar/durabletask/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/affandar/durabletask/statuses/1387973f31bf4d060df93144bf144e3b03e30c6c"}}}}