{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/pulls/comments/217245955","pull_request_review_id":154896995,"id":217245955,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNzI0NTk1NQ==","diff_hunk":"@@ -11,14 +11,15 @@ namespace Microsoft.Azure.Documents.ChangeFeedProcessor.Monitoring\n     /// <summary>\n     /// A strategy for handling the situation when the change feed processor is not able to aquire lease due to unknown reasons.\n     /// </summary>\n-    public interface IUnhealthinessHandlingStrategy\n+    public interface IHealthinessMonitor\n     {\n         /// <summary>\n         /// A logic to handle that exceptional situation.\n         /// </summary>\n+        /// <param name=\"level\">The health level</param>\n+        /// <param name=\"phase\">The phase which reports healthiness or failure</param>\n         /// <param name=\"lease\">Last lease which the system tried to aquire but failed.</param>\n         /// <param name=\"exception\">Last unknonw exception thrown when the system tried to aquire the lease</param>\n-        /// <returns>Task</returns>\n-        Task HandleAsync(ILease lease, Exception exception);\n+        Task InspectAsync(HealthEventLevel level, HealthEventPhase phase, ILease lease, Exception exception = null);","path":"src/DocumentDB.ChangeFeedProcessor/Monitoring/IHealthinessMonitor.cs","position":null,"original_position":16,"commit_id":"1967583a3a3eec10eee63952f43391bcfa226454","original_commit_id":"1967583a3a3eec10eee63952f43391bcfa226454","user":{"login":"mkolt","id":17420292,"node_id":"MDQ6VXNlcjE3NDIwMjky","avatar_url":"https://avatars1.githubusercontent.com/u/17420292?v=4","gravatar_id":"","url":"https://api.github.com/users/mkolt","html_url":"https://github.com/mkolt","followers_url":"https://api.github.com/users/mkolt/followers","following_url":"https://api.github.com/users/mkolt/following{/other_user}","gists_url":"https://api.github.com/users/mkolt/gists{/gist_id}","starred_url":"https://api.github.com/users/mkolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkolt/subscriptions","organizations_url":"https://api.github.com/users/mkolt/orgs","repos_url":"https://api.github.com/users/mkolt/repos","events_url":"https://api.github.com/users/mkolt/events{/privacy}","received_events_url":"https://api.github.com/users/mkolt/received_events","type":"User","site_admin":false},"body":"Default parameters on public interfaces is not great for code safety (edge case when implementation has different default). Can we remove the default?","created_at":"2018-09-13T02:42:39Z","updated_at":"2018-09-13T02:43:28Z","html_url":"https://github.com/Azure/azure-documentdb-changefeedprocessor-dotnet/pull/100#discussion_r217245955","pull_request_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/pulls/100","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/pulls/comments/217245955"},"html":{"href":"https://github.com/Azure/azure-documentdb-changefeedprocessor-dotnet/pull/100#discussion_r217245955"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/pulls/100"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/pulls/100","id":212371769,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEyMzcxNzY5","html_url":"https://github.com/Azure/azure-documentdb-changefeedprocessor-dotnet/pull/100","diff_url":"https://github.com/Azure/azure-documentdb-changefeedprocessor-dotnet/pull/100.diff","patch_url":"https://github.com/Azure/azure-documentdb-changefeedprocessor-dotnet/pull/100.patch","issue_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/issues/100","number":100,"state":"open","locked":false,"title":"[proposal] detects that the instance is unhealthy","user":{"login":"kadukf","id":220550,"node_id":"MDQ6VXNlcjIyMDU1MA==","avatar_url":"https://avatars0.githubusercontent.com/u/220550?v=4","gravatar_id":"","url":"https://api.github.com/users/kadukf","html_url":"https://github.com/kadukf","followers_url":"https://api.github.com/users/kadukf/followers","following_url":"https://api.github.com/users/kadukf/following{/other_user}","gists_url":"https://api.github.com/users/kadukf/gists{/gist_id}","starred_url":"https://api.github.com/users/kadukf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kadukf/subscriptions","organizations_url":"https://api.github.com/users/kadukf/orgs","repos_url":"https://api.github.com/users/kadukf/repos","events_url":"https://api.github.com/users/kadukf/events{/privacy}","received_events_url":"https://api.github.com/users/kadukf/received_events","type":"User","site_admin":false},"body":"It would be good to detect that the instance is unhealthy, we had several times a production issue due to it. \r\n\r\nUnhealthy = acquiring the leases is failing due to unknown reasons. \r\n\r\nIn case processor is not able to commit the feed (any kind issue), it will release the lease. After that the same processor instance (after lease expiration time) will try to acquire the lease (same code as commit the feed). If the lease updating is constantly failing due to unknown reasons, we could treat the processor instance as unhealthy. If this situation stays for e.g. 5 x lease expiration timeout => unhealthyhandlingstrategy will be asked to handle it, e.g. fail fast or we can just silently stop the processor + we could make it configurable using CFPBuilder.WithUnhealthnessHandlingStrategy().\r\n\r\n wdyt?","created_at":"2018-08-31T12:44:52Z","updated_at":"2018-09-13T02:43:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c2c4107d706eced3373f5e56c7cdc4c01b826d87","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/pulls/100/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/pulls/100/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/issues/100/comments","statuses_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/statuses/1967583a3a3eec10eee63952f43391bcfa226454","head":{"label":"Azure:pr/unhealthy_detection_proposal","ref":"pr/unhealthy_detection_proposal","sha":"1967583a3a3eec10eee63952f43391bcfa226454","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":111577794,"node_id":"MDEwOlJlcG9zaXRvcnkxMTE1Nzc3OTQ=","name":"azure-documentdb-changefeedprocessor-dotnet","full_name":"Azure/azure-documentdb-changefeedprocessor-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-documentdb-changefeedprocessor-dotnet","description":"This library provides a host for distributing change feed events in partitioned collection across multiple observers. Instances of the host can scale up (by adding) or down (by removing) dynamically, and the load will be automatically distributed among active instances in about-equal way.","fork":false,"url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet","forks_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/forks","keys_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/teams","hooks_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/events","assignees_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/tags","blobs_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/subscription","commits_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/merges","archive_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/downloads","issues_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/deployments","created_at":"2017-11-21T17:03:23Z","updated_at":"2018-09-11T20:29:55Z","pushed_at":"2018-09-12T16:21:44Z","git_url":"git://github.com/Azure/azure-documentdb-changefeedprocessor-dotnet.git","ssh_url":"git@github.com:Azure/azure-documentdb-changefeedprocessor-dotnet.git","clone_url":"https://github.com/Azure/azure-documentdb-changefeedprocessor-dotnet.git","svn_url":"https://github.com/Azure/azure-documentdb-changefeedprocessor-dotnet","homepage":null,"size":373,"stargazers_count":11,"watchers_count":11,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":7,"open_issues":9,"watchers":11,"default_branch":"master"}},"base":{"label":"Azure:master","ref":"master","sha":"ae7c59c116ffc1ad33b69c314c72607a7a87ddc2","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":111577794,"node_id":"MDEwOlJlcG9zaXRvcnkxMTE1Nzc3OTQ=","name":"azure-documentdb-changefeedprocessor-dotnet","full_name":"Azure/azure-documentdb-changefeedprocessor-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-documentdb-changefeedprocessor-dotnet","description":"This library provides a host for distributing change feed events in partitioned collection across multiple observers. Instances of the host can scale up (by adding) or down (by removing) dynamically, and the load will be automatically distributed among active instances in about-equal way.","fork":false,"url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet","forks_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/forks","keys_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/teams","hooks_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/events","assignees_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/tags","blobs_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/subscription","commits_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/merges","archive_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/downloads","issues_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/deployments","created_at":"2017-11-21T17:03:23Z","updated_at":"2018-09-11T20:29:55Z","pushed_at":"2018-09-12T16:21:44Z","git_url":"git://github.com/Azure/azure-documentdb-changefeedprocessor-dotnet.git","ssh_url":"git@github.com:Azure/azure-documentdb-changefeedprocessor-dotnet.git","clone_url":"https://github.com/Azure/azure-documentdb-changefeedprocessor-dotnet.git","svn_url":"https://github.com/Azure/azure-documentdb-changefeedprocessor-dotnet","homepage":null,"size":373,"stargazers_count":11,"watchers_count":11,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":7,"open_issues":9,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/pulls/100"},"html":{"href":"https://github.com/Azure/azure-documentdb-changefeedprocessor-dotnet/pull/100"},"issue":{"href":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/issues/100"},"comments":{"href":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/issues/100/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/pulls/100/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/pulls/100/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-documentdb-changefeedprocessor-dotnet/statuses/1967583a3a3eec10eee63952f43391bcfa226454"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"mkolt"}}