{"action":"created","comment":{"url":"https://api.github.com/repos/pravega/pravega/pulls/comments/200986881","pull_request_review_id":135398473,"id":200986881,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDk4Njg4MQ==","diff_hunk":"@@ -399,6 +400,17 @@ public void createSegment(CreateSegment createStreamsSegment) {\n                 });\n     }\n \n+    private Void handleReadException(long readOffset, String segment, Throwable u) {","path":"segmentstore/server/host/src/main/java/io/pravega/segmentstore/server/host/handler/PravegaRequestProcessor.java","position":44,"original_position":44,"commit_id":"1723d23a25482216f9ced3cff1ece2e0b42aa0b3","original_commit_id":"1723d23a25482216f9ced3cff1ece2e0b42aa0b3","user":{"login":"fpj","id":572920,"node_id":"MDQ6VXNlcjU3MjkyMA==","avatar_url":"https://avatars3.githubusercontent.com/u/572920?v=4","gravatar_id":"","url":"https://api.github.com/users/fpj","html_url":"https://github.com/fpj","followers_url":"https://api.github.com/users/fpj/followers","following_url":"https://api.github.com/users/fpj/following{/other_user}","gists_url":"https://api.github.com/users/fpj/gists{/gist_id}","starred_url":"https://api.github.com/users/fpj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpj/subscriptions","organizations_url":"https://api.github.com/users/fpj/orgs","repos_url":"https://api.github.com/users/fpj/repos","events_url":"https://api.github.com/users/fpj/events{/privacy}","received_events_url":"https://api.github.com/users/fpj/received_events","type":"User","site_admin":false},"body":"I think the reason why you are creating a separate `handleReadException` rather than deal with `CancellationException` in `handleException` is that you need to know that it is a `CancellationException` out of a read request and you don't want to handle generally `CancellationException` in `handleException`.\r\n\r\nAssuming this reasoning is correct, `CancellationException` by itself is not giving enough information for us to handle the exception appropriately. The overall flow looks ok, but the idea of handling the exception separately is not aligned with the rest of the code in PRP. \r\n\r\nTwo options I can think of to deal with this:\r\n1- The exception that the segment store throws should have a narrower scope, e.g., `ReadCancellationException`.\r\n2- In `handleReadResult`, we wrap `CancellationException` with something else, e.g., `ReadCancellationException` so that we can disambiguate in `handleException`.\r\n\r\nThe idea would be to catch and handle the exception in `handleException` rather than add this new method.","created_at":"2018-07-09T12:41:00Z","updated_at":"2018-07-09T12:41:43Z","html_url":"https://github.com/pravega/pravega/pull/2747#discussion_r200986881","pull_request_url":"https://api.github.com/repos/pravega/pravega/pulls/2747","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/pravega/pravega/pulls/comments/200986881"},"html":{"href":"https://github.com/pravega/pravega/pull/2747#discussion_r200986881"},"pull_request":{"href":"https://api.github.com/repos/pravega/pravega/pulls/2747"}}},"pull_request":{"url":"https://api.github.com/repos/pravega/pravega/pulls/2747","id":200007794,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAwMDA3Nzk0","html_url":"https://github.com/pravega/pravega/pull/2747","diff_url":"https://github.com/pravega/pravega/pull/2747.diff","patch_url":"https://github.com/pravega/pravega/pull/2747.patch","issue_url":"https://api.github.com/repos/pravega/pravega/issues/2747","number":2747,"state":"open","locked":false,"title":"Issue 2746: PravegaRequestProcessor should send an empty Read result before cancelling Read request.","user":{"login":"shrids","id":11114165,"node_id":"MDQ6VXNlcjExMTE0MTY1","avatar_url":"https://avatars1.githubusercontent.com/u/11114165?v=4","gravatar_id":"","url":"https://api.github.com/users/shrids","html_url":"https://github.com/shrids","followers_url":"https://api.github.com/users/shrids/followers","following_url":"https://api.github.com/users/shrids/following{/other_user}","gists_url":"https://api.github.com/users/shrids/gists{/gist_id}","starred_url":"https://api.github.com/users/shrids/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shrids/subscriptions","organizations_url":"https://api.github.com/users/shrids/orgs","repos_url":"https://api.github.com/users/shrids/repos","events_url":"https://api.github.com/users/shrids/events{/privacy}","received_events_url":"https://api.github.com/users/shrids/received_events","type":"User","site_admin":false},"body":"(Do Not Merge, testing in progress).\r\n**Change log description**\r\n\r\nEnsure an empty `WireCommands.SegmentRead` is sent before closing the connection while cancelling pending read requests.\r\n\r\n**Purpose of the change**\r\nFixes #2746\r\n\r\n**What the code does**\r\nOn receiving a `CancellationException` for a read request ensure PravegaRequestProcessor sends and empty SegmentRead message before closing the connection.\r\n\r\n**How to verify it**\r\nAll the existing tests and newly added tests should pass.","created_at":"2018-07-09T07:01:25Z","updated_at":"2018-07-09T12:41:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d458a8bc3ab1f4100b1f951e09f3f8e5e566be4a","assignee":{"login":"fpj","id":572920,"node_id":"MDQ6VXNlcjU3MjkyMA==","avatar_url":"https://avatars3.githubusercontent.com/u/572920?v=4","gravatar_id":"","url":"https://api.github.com/users/fpj","html_url":"https://github.com/fpj","followers_url":"https://api.github.com/users/fpj/followers","following_url":"https://api.github.com/users/fpj/following{/other_user}","gists_url":"https://api.github.com/users/fpj/gists{/gist_id}","starred_url":"https://api.github.com/users/fpj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpj/subscriptions","organizations_url":"https://api.github.com/users/fpj/orgs","repos_url":"https://api.github.com/users/fpj/repos","events_url":"https://api.github.com/users/fpj/events{/privacy}","received_events_url":"https://api.github.com/users/fpj/received_events","type":"User","site_admin":false},"assignees":[{"login":"fpj","id":572920,"node_id":"MDQ6VXNlcjU3MjkyMA==","avatar_url":"https://avatars3.githubusercontent.com/u/572920?v=4","gravatar_id":"","url":"https://api.github.com/users/fpj","html_url":"https://github.com/fpj","followers_url":"https://api.github.com/users/fpj/followers","following_url":"https://api.github.com/users/fpj/following{/other_user}","gists_url":"https://api.github.com/users/fpj/gists{/gist_id}","starred_url":"https://api.github.com/users/fpj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpj/subscriptions","organizations_url":"https://api.github.com/users/fpj/orgs","repos_url":"https://api.github.com/users/fpj/repos","events_url":"https://api.github.com/users/fpj/events{/privacy}","received_events_url":"https://api.github.com/users/fpj/received_events","type":"User","site_admin":false},{"login":"tkaitchuck","id":4756752,"node_id":"MDQ6VXNlcjQ3NTY3NTI=","avatar_url":"https://avatars1.githubusercontent.com/u/4756752?v=4","gravatar_id":"","url":"https://api.github.com/users/tkaitchuck","html_url":"https://github.com/tkaitchuck","followers_url":"https://api.github.com/users/tkaitchuck/followers","following_url":"https://api.github.com/users/tkaitchuck/following{/other_user}","gists_url":"https://api.github.com/users/tkaitchuck/gists{/gist_id}","starred_url":"https://api.github.com/users/tkaitchuck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkaitchuck/subscriptions","organizations_url":"https://api.github.com/users/tkaitchuck/orgs","repos_url":"https://api.github.com/users/tkaitchuck/repos","events_url":"https://api.github.com/users/tkaitchuck/events{/privacy}","received_events_url":"https://api.github.com/users/tkaitchuck/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"tkaitchuck","id":4756752,"node_id":"MDQ6VXNlcjQ3NTY3NTI=","avatar_url":"https://avatars1.githubusercontent.com/u/4756752?v=4","gravatar_id":"","url":"https://api.github.com/users/tkaitchuck","html_url":"https://github.com/tkaitchuck","followers_url":"https://api.github.com/users/tkaitchuck/followers","following_url":"https://api.github.com/users/tkaitchuck/following{/other_user}","gists_url":"https://api.github.com/users/tkaitchuck/gists{/gist_id}","starred_url":"https://api.github.com/users/tkaitchuck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkaitchuck/subscriptions","organizations_url":"https://api.github.com/users/tkaitchuck/orgs","repos_url":"https://api.github.com/users/tkaitchuck/repos","events_url":"https://api.github.com/users/tkaitchuck/events{/privacy}","received_events_url":"https://api.github.com/users/tkaitchuck/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pravega/pravega/pulls/2747/commits","review_comments_url":"https://api.github.com/repos/pravega/pravega/pulls/2747/comments","review_comment_url":"https://api.github.com/repos/pravega/pravega/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pravega/pravega/issues/2747/comments","statuses_url":"https://api.github.com/repos/pravega/pravega/statuses/1723d23a25482216f9ced3cff1ece2e0b42aa0b3","head":{"label":"shrids:issue-2746-CancellationException","ref":"issue-2746-CancellationException","sha":"1723d23a25482216f9ced3cff1ece2e0b42aa0b3","user":{"login":"shrids","id":11114165,"node_id":"MDQ6VXNlcjExMTE0MTY1","avatar_url":"https://avatars1.githubusercontent.com/u/11114165?v=4","gravatar_id":"","url":"https://api.github.com/users/shrids","html_url":"https://github.com/shrids","followers_url":"https://api.github.com/users/shrids/followers","following_url":"https://api.github.com/users/shrids/following{/other_user}","gists_url":"https://api.github.com/users/shrids/gists{/gist_id}","starred_url":"https://api.github.com/users/shrids/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shrids/subscriptions","organizations_url":"https://api.github.com/users/shrids/orgs","repos_url":"https://api.github.com/users/shrids/repos","events_url":"https://api.github.com/users/shrids/events{/privacy}","received_events_url":"https://api.github.com/users/shrids/received_events","type":"User","site_admin":false},"repo":{"id":90976985,"node_id":"MDEwOlJlcG9zaXRvcnk5MDk3Njk4NQ==","name":"pravega","full_name":"shrids/pravega","owner":{"login":"shrids","id":11114165,"node_id":"MDQ6VXNlcjExMTE0MTY1","avatar_url":"https://avatars1.githubusercontent.com/u/11114165?v=4","gravatar_id":"","url":"https://api.github.com/users/shrids","html_url":"https://github.com/shrids","followers_url":"https://api.github.com/users/shrids/followers","following_url":"https://api.github.com/users/shrids/following{/other_user}","gists_url":"https://api.github.com/users/shrids/gists{/gist_id}","starred_url":"https://api.github.com/users/shrids/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shrids/subscriptions","organizations_url":"https://api.github.com/users/shrids/orgs","repos_url":"https://api.github.com/users/shrids/repos","events_url":"https://api.github.com/users/shrids/events{/privacy}","received_events_url":"https://api.github.com/users/shrids/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shrids/pravega","description":"Pravega - Streaming as a new software defined storage primitive","fork":true,"url":"https://api.github.com/repos/shrids/pravega","forks_url":"https://api.github.com/repos/shrids/pravega/forks","keys_url":"https://api.github.com/repos/shrids/pravega/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shrids/pravega/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shrids/pravega/teams","hooks_url":"https://api.github.com/repos/shrids/pravega/hooks","issue_events_url":"https://api.github.com/repos/shrids/pravega/issues/events{/number}","events_url":"https://api.github.com/repos/shrids/pravega/events","assignees_url":"https://api.github.com/repos/shrids/pravega/assignees{/user}","branches_url":"https://api.github.com/repos/shrids/pravega/branches{/branch}","tags_url":"https://api.github.com/repos/shrids/pravega/tags","blobs_url":"https://api.github.com/repos/shrids/pravega/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shrids/pravega/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shrids/pravega/git/refs{/sha}","trees_url":"https://api.github.com/repos/shrids/pravega/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shrids/pravega/statuses/{sha}","languages_url":"https://api.github.com/repos/shrids/pravega/languages","stargazers_url":"https://api.github.com/repos/shrids/pravega/stargazers","contributors_url":"https://api.github.com/repos/shrids/pravega/contributors","subscribers_url":"https://api.github.com/repos/shrids/pravega/subscribers","subscription_url":"https://api.github.com/repos/shrids/pravega/subscription","commits_url":"https://api.github.com/repos/shrids/pravega/commits{/sha}","git_commits_url":"https://api.github.com/repos/shrids/pravega/git/commits{/sha}","comments_url":"https://api.github.com/repos/shrids/pravega/comments{/number}","issue_comment_url":"https://api.github.com/repos/shrids/pravega/issues/comments{/number}","contents_url":"https://api.github.com/repos/shrids/pravega/contents/{+path}","compare_url":"https://api.github.com/repos/shrids/pravega/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shrids/pravega/merges","archive_url":"https://api.github.com/repos/shrids/pravega/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shrids/pravega/downloads","issues_url":"https://api.github.com/repos/shrids/pravega/issues{/number}","pulls_url":"https://api.github.com/repos/shrids/pravega/pulls{/number}","milestones_url":"https://api.github.com/repos/shrids/pravega/milestones{/number}","notifications_url":"https://api.github.com/repos/shrids/pravega/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shrids/pravega/labels{/name}","releases_url":"https://api.github.com/repos/shrids/pravega/releases{/id}","deployments_url":"https://api.github.com/repos/shrids/pravega/deployments","created_at":"2017-05-11T12:31:46Z","updated_at":"2018-07-09T04:14:45Z","pushed_at":"2018-07-09T07:44:15Z","git_url":"git://github.com/shrids/pravega.git","ssh_url":"git@github.com:shrids/pravega.git","clone_url":"https://github.com/shrids/pravega.git","svn_url":"https://github.com/shrids/pravega","homepage":"http://pravega.io","size":25843,"stargazers_count":0,"watchers_count":0,"language":"Java","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":5,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"pravega:master","ref":"master","sha":"73991815f68abc7fcf6ece97f2b9ee0709ba9e30","user":{"login":"pravega","id":25698199,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1Njk4MTk5","avatar_url":"https://avatars1.githubusercontent.com/u/25698199?v=4","gravatar_id":"","url":"https://api.github.com/users/pravega","html_url":"https://github.com/pravega","followers_url":"https://api.github.com/users/pravega/followers","following_url":"https://api.github.com/users/pravega/following{/other_user}","gists_url":"https://api.github.com/users/pravega/gists{/gist_id}","starred_url":"https://api.github.com/users/pravega/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pravega/subscriptions","organizations_url":"https://api.github.com/users/pravega/orgs","repos_url":"https://api.github.com/users/pravega/repos","events_url":"https://api.github.com/users/pravega/events{/privacy}","received_events_url":"https://api.github.com/users/pravega/received_events","type":"Organization","site_admin":false},"repo":{"id":63096822,"node_id":"MDEwOlJlcG9zaXRvcnk2MzA5NjgyMg==","name":"pravega","full_name":"pravega/pravega","owner":{"login":"pravega","id":25698199,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1Njk4MTk5","avatar_url":"https://avatars1.githubusercontent.com/u/25698199?v=4","gravatar_id":"","url":"https://api.github.com/users/pravega","html_url":"https://github.com/pravega","followers_url":"https://api.github.com/users/pravega/followers","following_url":"https://api.github.com/users/pravega/following{/other_user}","gists_url":"https://api.github.com/users/pravega/gists{/gist_id}","starred_url":"https://api.github.com/users/pravega/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pravega/subscriptions","organizations_url":"https://api.github.com/users/pravega/orgs","repos_url":"https://api.github.com/users/pravega/repos","events_url":"https://api.github.com/users/pravega/events{/privacy}","received_events_url":"https://api.github.com/users/pravega/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pravega/pravega","description":"Pravega - Streaming as a new software defined storage primitive","fork":false,"url":"https://api.github.com/repos/pravega/pravega","forks_url":"https://api.github.com/repos/pravega/pravega/forks","keys_url":"https://api.github.com/repos/pravega/pravega/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pravega/pravega/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pravega/pravega/teams","hooks_url":"https://api.github.com/repos/pravega/pravega/hooks","issue_events_url":"https://api.github.com/repos/pravega/pravega/issues/events{/number}","events_url":"https://api.github.com/repos/pravega/pravega/events","assignees_url":"https://api.github.com/repos/pravega/pravega/assignees{/user}","branches_url":"https://api.github.com/repos/pravega/pravega/branches{/branch}","tags_url":"https://api.github.com/repos/pravega/pravega/tags","blobs_url":"https://api.github.com/repos/pravega/pravega/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pravega/pravega/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pravega/pravega/git/refs{/sha}","trees_url":"https://api.github.com/repos/pravega/pravega/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pravega/pravega/statuses/{sha}","languages_url":"https://api.github.com/repos/pravega/pravega/languages","stargazers_url":"https://api.github.com/repos/pravega/pravega/stargazers","contributors_url":"https://api.github.com/repos/pravega/pravega/contributors","subscribers_url":"https://api.github.com/repos/pravega/pravega/subscribers","subscription_url":"https://api.github.com/repos/pravega/pravega/subscription","commits_url":"https://api.github.com/repos/pravega/pravega/commits{/sha}","git_commits_url":"https://api.github.com/repos/pravega/pravega/git/commits{/sha}","comments_url":"https://api.github.com/repos/pravega/pravega/comments{/number}","issue_comment_url":"https://api.github.com/repos/pravega/pravega/issues/comments{/number}","contents_url":"https://api.github.com/repos/pravega/pravega/contents/{+path}","compare_url":"https://api.github.com/repos/pravega/pravega/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pravega/pravega/merges","archive_url":"https://api.github.com/repos/pravega/pravega/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pravega/pravega/downloads","issues_url":"https://api.github.com/repos/pravega/pravega/issues{/number}","pulls_url":"https://api.github.com/repos/pravega/pravega/pulls{/number}","milestones_url":"https://api.github.com/repos/pravega/pravega/milestones{/number}","notifications_url":"https://api.github.com/repos/pravega/pravega/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pravega/pravega/labels{/name}","releases_url":"https://api.github.com/repos/pravega/pravega/releases{/id}","deployments_url":"https://api.github.com/repos/pravega/pravega/deployments","created_at":"2016-07-11T19:41:03Z","updated_at":"2018-07-03T14:00:25Z","pushed_at":"2018-07-09T07:01:26Z","git_url":"git://github.com/pravega/pravega.git","ssh_url":"git@github.com:pravega/pravega.git","clone_url":"https://github.com/pravega/pravega.git","svn_url":"https://github.com/pravega/pravega","homepage":"http://pravega.io","size":26025,"stargazers_count":225,"watchers_count":225,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":78,"mirror_url":null,"archived":false,"open_issues_count":345,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":78,"open_issues":345,"watchers":225,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pravega/pravega/pulls/2747"},"html":{"href":"https://github.com/pravega/pravega/pull/2747"},"issue":{"href":"https://api.github.com/repos/pravega/pravega/issues/2747"},"comments":{"href":"https://api.github.com/repos/pravega/pravega/issues/2747/comments"},"review_comments":{"href":"https://api.github.com/repos/pravega/pravega/pulls/2747/comments"},"review_comment":{"href":"https://api.github.com/repos/pravega/pravega/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pravega/pravega/pulls/2747/commits"},"statuses":{"href":"https://api.github.com/repos/pravega/pravega/statuses/1723d23a25482216f9ced3cff1ece2e0b42aa0b3"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"fpj"}}