{"action":"created","comment":{"url":"https://api.github.com/repos/akka/akka/pulls/comments/52321135","id":52321135,"diff_hunk":"@@ -55,6 +55,9 @@ The connection can also be closed by the server.\n An application can actively trigger the closing of the connection by completing the request stream. In this case the\n underlying TCP connection will be closed when the last pending response has been received.\n \n+Connection will also be closed if response entity has been cancelled (e.g. by attaching it to ``Sink.cancelled``)\n+or consumed only partially (e.g. by calling ``take()`` on it). In order to prevent this behaviour entity should be\n+explicitly drained by attaching it to ``Sink.ignore``.","path":"akka-docs/rst/scala/http/client-side/connection-level.rst","position":6,"original_position":6,"commit_id":"43907bb795a8b63406f6e92943349dcdf521847e","original_commit_id":"43907bb795a8b63406f6e92943349dcdf521847e","user":{"login":"ktoso","id":120979,"avatar_url":"https://avatars.githubusercontent.com/u/120979?v=3","gravatar_id":"","url":"https://api.github.com/users/ktoso","html_url":"https://github.com/ktoso","followers_url":"https://api.github.com/users/ktoso/followers","following_url":"https://api.github.com/users/ktoso/following{/other_user}","gists_url":"https://api.github.com/users/ktoso/gists{/gist_id}","starred_url":"https://api.github.com/users/ktoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktoso/subscriptions","organizations_url":"https://api.github.com/users/ktoso/orgs","repos_url":"https://api.github.com/users/ktoso/repos","events_url":"https://api.github.com/users/ktoso/events{/privacy}","received_events_url":"https://api.github.com/users/ktoso/received_events","type":"User","site_admin":false},"body":":+1: had a comment around the same thing https://github.com/akka/akka/pull/19528#discussion_r52298380","created_at":"2016-02-09T15:21:13Z","updated_at":"2016-02-09T15:21:13Z","html_url":"https://github.com/akka/akka/pull/19528#discussion_r52321135","pull_request_url":"https://api.github.com/repos/akka/akka/pulls/19528","_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/comments/52321135"},"html":{"href":"https://github.com/akka/akka/pull/19528#discussion_r52321135"},"pull_request":{"href":"https://api.github.com/repos/akka/akka/pulls/19528"}}},"pull_request":{"url":"https://api.github.com/repos/akka/akka/pulls/19528","id":56575692,"html_url":"https://github.com/akka/akka/pull/19528","diff_url":"https://github.com/akka/akka/pull/19528.diff","patch_url":"https://github.com/akka/akka/pull/19528.patch","issue_url":"https://api.github.com/repos/akka/akka/issues/19528","number":19528,"state":"open","locked":false,"title":"Http: HttpEntity stream cancellation","user":{"login":"ataraxer","id":1394955,"avatar_url":"https://avatars.githubusercontent.com/u/1394955?v=3","gravatar_id":"","url":"https://api.github.com/users/ataraxer","html_url":"https://github.com/ataraxer","followers_url":"https://api.github.com/users/ataraxer/followers","following_url":"https://api.github.com/users/ataraxer/following{/other_user}","gists_url":"https://api.github.com/users/ataraxer/gists{/gist_id}","starred_url":"https://api.github.com/users/ataraxer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ataraxer/subscriptions","organizations_url":"https://api.github.com/users/ataraxer/orgs","repos_url":"https://api.github.com/users/ataraxer/repos","events_url":"https://api.github.com/users/ataraxer/events{/privacy}","received_events_url":"https://api.github.com/users/ataraxer/received_events","type":"User","site_admin":false},"body":"Here's an attempt to solve issues #18010 and #18203.\r\n\r\nFirst commit can be treated as a simpler version of the solution, which involves adding `eagerClose` flag to `splitWhen` in order to define how substream cancelation should be treated: by draining the remaining elements in order to prevent stalling (current behaviour) or cancelling the stage altogether.\r\n\r\nSecond one introduces custom stage instead of `splitWhen/prefixAndTail` pipeline, which would allow to add `eagerClose` flag to `outgoingConnection` without adding flag to `splitWhen`/`splitAt` if this change isn't plausible.\r\n\r\nI used https://github.com/akka/akka/commit/ced5aa7ddcac1408e08ed159da9a04fecfad18ed as a reference, however there are some slight changes which will be marked in comments to particular lines.","created_at":"2016-01-20T08:08:48Z","updated_at":"2016-02-09T15:21:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bbe529f0b28b1c055615ddcab7a1b782615e4c17","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/akka/akka/pulls/19528/commits","review_comments_url":"https://api.github.com/repos/akka/akka/pulls/19528/comments","review_comment_url":"https://api.github.com/repos/akka/akka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/akka/akka/issues/19528/comments","statuses_url":"https://api.github.com/repos/akka/akka/statuses/43907bb795a8b63406f6e92943349dcdf521847e","head":{"label":"ataraxer:wip-http-response-cancellation","ref":"wip-http-response-cancellation","sha":"43907bb795a8b63406f6e92943349dcdf521847e","user":{"login":"ataraxer","id":1394955,"avatar_url":"https://avatars.githubusercontent.com/u/1394955?v=3","gravatar_id":"","url":"https://api.github.com/users/ataraxer","html_url":"https://github.com/ataraxer","followers_url":"https://api.github.com/users/ataraxer/followers","following_url":"https://api.github.com/users/ataraxer/following{/other_user}","gists_url":"https://api.github.com/users/ataraxer/gists{/gist_id}","starred_url":"https://api.github.com/users/ataraxer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ataraxer/subscriptions","organizations_url":"https://api.github.com/users/ataraxer/orgs","repos_url":"https://api.github.com/users/ataraxer/repos","events_url":"https://api.github.com/users/ataraxer/events{/privacy}","received_events_url":"https://api.github.com/users/ataraxer/received_events","type":"User","site_admin":false},"repo":{"id":32074531,"name":"akka","full_name":"ataraxer/akka","owner":{"login":"ataraxer","id":1394955,"avatar_url":"https://avatars.githubusercontent.com/u/1394955?v=3","gravatar_id":"","url":"https://api.github.com/users/ataraxer","html_url":"https://github.com/ataraxer","followers_url":"https://api.github.com/users/ataraxer/followers","following_url":"https://api.github.com/users/ataraxer/following{/other_user}","gists_url":"https://api.github.com/users/ataraxer/gists{/gist_id}","starred_url":"https://api.github.com/users/ataraxer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ataraxer/subscriptions","organizations_url":"https://api.github.com/users/ataraxer/orgs","repos_url":"https://api.github.com/users/ataraxer/repos","events_url":"https://api.github.com/users/ataraxer/events{/privacy}","received_events_url":"https://api.github.com/users/ataraxer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ataraxer/akka","description":"Akka Project","fork":true,"url":"https://api.github.com/repos/ataraxer/akka","forks_url":"https://api.github.com/repos/ataraxer/akka/forks","keys_url":"https://api.github.com/repos/ataraxer/akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ataraxer/akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ataraxer/akka/teams","hooks_url":"https://api.github.com/repos/ataraxer/akka/hooks","issue_events_url":"https://api.github.com/repos/ataraxer/akka/issues/events{/number}","events_url":"https://api.github.com/repos/ataraxer/akka/events","assignees_url":"https://api.github.com/repos/ataraxer/akka/assignees{/user}","branches_url":"https://api.github.com/repos/ataraxer/akka/branches{/branch}","tags_url":"https://api.github.com/repos/ataraxer/akka/tags","blobs_url":"https://api.github.com/repos/ataraxer/akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ataraxer/akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ataraxer/akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/ataraxer/akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ataraxer/akka/statuses/{sha}","languages_url":"https://api.github.com/repos/ataraxer/akka/languages","stargazers_url":"https://api.github.com/repos/ataraxer/akka/stargazers","contributors_url":"https://api.github.com/repos/ataraxer/akka/contributors","subscribers_url":"https://api.github.com/repos/ataraxer/akka/subscribers","subscription_url":"https://api.github.com/repos/ataraxer/akka/subscription","commits_url":"https://api.github.com/repos/ataraxer/akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/ataraxer/akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/ataraxer/akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/ataraxer/akka/issues/comments{/number}","contents_url":"https://api.github.com/repos/ataraxer/akka/contents/{+path}","compare_url":"https://api.github.com/repos/ataraxer/akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ataraxer/akka/merges","archive_url":"https://api.github.com/repos/ataraxer/akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ataraxer/akka/downloads","issues_url":"https://api.github.com/repos/ataraxer/akka/issues{/number}","pulls_url":"https://api.github.com/repos/ataraxer/akka/pulls{/number}","milestones_url":"https://api.github.com/repos/ataraxer/akka/milestones{/number}","notifications_url":"https://api.github.com/repos/ataraxer/akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ataraxer/akka/labels{/name}","releases_url":"https://api.github.com/repos/ataraxer/akka/releases{/id}","deployments_url":"https://api.github.com/repos/ataraxer/akka/deployments","created_at":"2015-03-12T11:59:23Z","updated_at":"2016-02-02T09:51:11Z","pushed_at":"2016-02-09T07:13:51Z","git_url":"git://github.com/ataraxer/akka.git","ssh_url":"git@github.com:ataraxer/akka.git","clone_url":"https://github.com/ataraxer/akka.git","svn_url":"https://github.com/ataraxer/akka","homepage":"http://akka.io","size":174129,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"akka:master","ref":"master","sha":"9880ad267854b10f284f283515deb65fcf533253","user":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=3","gravatar_id":"","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"repo":{"id":130013,"name":"akka","full_name":"akka/akka","owner":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=3","gravatar_id":"","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/akka/akka","description":"Akka Project","fork":false,"url":"https://api.github.com/repos/akka/akka","forks_url":"https://api.github.com/repos/akka/akka/forks","keys_url":"https://api.github.com/repos/akka/akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akka/akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akka/akka/teams","hooks_url":"https://api.github.com/repos/akka/akka/hooks","issue_events_url":"https://api.github.com/repos/akka/akka/issues/events{/number}","events_url":"https://api.github.com/repos/akka/akka/events","assignees_url":"https://api.github.com/repos/akka/akka/assignees{/user}","branches_url":"https://api.github.com/repos/akka/akka/branches{/branch}","tags_url":"https://api.github.com/repos/akka/akka/tags","blobs_url":"https://api.github.com/repos/akka/akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akka/akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akka/akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/akka/akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akka/akka/statuses/{sha}","languages_url":"https://api.github.com/repos/akka/akka/languages","stargazers_url":"https://api.github.com/repos/akka/akka/stargazers","contributors_url":"https://api.github.com/repos/akka/akka/contributors","subscribers_url":"https://api.github.com/repos/akka/akka/subscribers","subscription_url":"https://api.github.com/repos/akka/akka/subscription","commits_url":"https://api.github.com/repos/akka/akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/akka/akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/akka/akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/akka/akka/issues/comments{/number}","contents_url":"https://api.github.com/repos/akka/akka/contents/{+path}","compare_url":"https://api.github.com/repos/akka/akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akka/akka/merges","archive_url":"https://api.github.com/repos/akka/akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akka/akka/downloads","issues_url":"https://api.github.com/repos/akka/akka/issues{/number}","pulls_url":"https://api.github.com/repos/akka/akka/pulls{/number}","milestones_url":"https://api.github.com/repos/akka/akka/milestones{/number}","notifications_url":"https://api.github.com/repos/akka/akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akka/akka/labels{/name}","releases_url":"https://api.github.com/repos/akka/akka/releases{/id}","deployments_url":"https://api.github.com/repos/akka/akka/deployments","created_at":"2009-02-16T12:51:54Z","updated_at":"2016-02-09T01:00:03Z","pushed_at":"2016-02-09T15:13:31Z","git_url":"git://github.com/akka/akka.git","ssh_url":"git@github.com:akka/akka.git","clone_url":"https://github.com/akka/akka.git","svn_url":"https://github.com/akka/akka","homepage":"http://akka.io","size":183765,"stargazers_count":5088,"watchers_count":5088,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1558,"mirror_url":null,"open_issues_count":876,"forks":1558,"open_issues":876,"watchers":5088,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/19528"},"html":{"href":"https://github.com/akka/akka/pull/19528"},"issue":{"href":"https://api.github.com/repos/akka/akka/issues/19528"},"comments":{"href":"https://api.github.com/repos/akka/akka/issues/19528/comments"},"review_comments":{"href":"https://api.github.com/repos/akka/akka/pulls/19528/comments"},"review_comment":{"href":"https://api.github.com/repos/akka/akka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/akka/akka/pulls/19528/commits"},"statuses":{"href":"https://api.github.com/repos/akka/akka/statuses/43907bb795a8b63406f6e92943349dcdf521847e"}}}}