{"action":"created","comment":{"url":"https://api.github.com/repos/twitter/finagle/pulls/comments/227493170","pull_request_review_id":167547809,"id":227493170,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNzQ5MzE3MA==","diff_hunk":"@@ -12,9 +12,18 @@ import io.netty.handler.codec.http._\n  */\n private[http] class FixedLengthMessageAggregator(\n   maxContentLength: StorageUnit,\n-  handleExpectContinue: Boolean = true\n+  dechunkThreshold: StorageUnit,","path":"finagle-netty4-http/src/main/scala/com/twitter/finagle/netty4/http/handler/FixedLengthMessageAggregator.scala","position":5,"original_position":5,"commit_id":"94eca45610e95995a31fd991e653cb6919a6305d","original_commit_id":"94eca45610e95995a31fd991e653cb6919a6305d","user":{"login":"edio","id":787439,"node_id":"MDQ6VXNlcjc4NzQzOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/787439?v=4","gravatar_id":"","url":"https://api.github.com/users/edio","html_url":"https://github.com/edio","followers_url":"https://api.github.com/users/edio/followers","following_url":"https://api.github.com/users/edio/following{/other_user}","gists_url":"https://api.github.com/users/edio/gists{/gist_id}","starred_url":"https://api.github.com/users/edio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edio/subscriptions","organizations_url":"https://api.github.com/users/edio/orgs","repos_url":"https://api.github.com/users/edio/repos","events_url":"https://api.github.com/users/edio/events{/privacy}","received_events_url":"https://api.github.com/users/edio/received_events","type":"User","site_admin":false},"body":"I agree. I'm reworking this code right now and came to the same conclusion.\r\n\r\nInitially I wasn't sure, if we can set maxContentLength to 0 and still retain all the features.\r\nNow I looked carefully in the code, and it seems, that the only case when we really allocate something on buf is when there's a `HttpMessage` with following `HttpContent`.\r\n\r\nAll other cases only make sure, that the request, when it makes sense, has `isChunked` set to `false` and content is available as string or buf.\r\n\r\nI wonder even, if it makes sense to eventually split `FixedLengthMessageAggregator` so it has more clear purpose: one class should handle actual aggregation,  and the other one should handle all the quirks, like noContentResponse and messages without content-length and trasfer-encoding headers..","created_at":"2018-10-23T17:35:34Z","updated_at":"2018-10-23T17:35:34Z","html_url":"https://github.com/twitter/finagle/pull/740#discussion_r227493170","pull_request_url":"https://api.github.com/repos/twitter/finagle/pulls/740","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/twitter/finagle/pulls/comments/227493170"},"html":{"href":"https://github.com/twitter/finagle/pull/740#discussion_r227493170"},"pull_request":{"href":"https://api.github.com/repos/twitter/finagle/pulls/740"}},"in_reply_to_id":227486887},"pull_request":{"url":"https://api.github.com/repos/twitter/finagle/pulls/740","id":224574823,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0NTc0ODIz","html_url":"https://github.com/twitter/finagle/pull/740","diff_url":"https://github.com/twitter/finagle/pull/740.diff","patch_url":"https://github.com/twitter/finagle/pull/740.patch","issue_url":"https://api.github.com/repos/twitter/finagle/issues/740","number":740,"state":"open","locked":false,"title":"finagle-http: introduce withDechunkThreshold","user":{"login":"edio","id":787439,"node_id":"MDQ6VXNlcjc4NzQzOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/787439?v=4","gravatar_id":"","url":"https://api.github.com/users/edio","html_url":"https://github.com/edio","followers_url":"https://api.github.com/users/edio/followers","following_url":"https://api.github.com/users/edio/following{/other_user}","gists_url":"https://api.github.com/users/edio/gists{/gist_id}","starred_url":"https://api.github.com/users/edio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edio/subscriptions","organizations_url":"https://api.github.com/users/edio/orgs","repos_url":"https://api.github.com/users/edio/repos","events_url":"https://api.github.com/users/edio/events{/privacy}","received_events_url":"https://api.github.com/users/edio/received_events","type":"User","site_admin":false},"body":"Problem\r\n\r\nServer.withStreaming(true) only enables streaming for requests with\r\nchunked encoding. Requests without Transfer-Enconding are still buffered\r\nup to max allowed request size. This is not desirable for some use cases\r\n\r\nhttps://github.com/twitter/finagle/issues/538\r\n\r\nSolution\r\n\r\nIntroduce new stack parameter DechunkThreshold which is passed to the\r\nFixedLengthMessageAggregator during construction of netty server\r\npipeline and is used to decide, whether aggregater should handle a\r\nmessage or should be bypassed.\r\nDefault value of the new parameter is infinity which ensures\r\nbackward-compatible behavior.\r\n\r\nResult\r\n\r\nFor example to stream unchunked requests larger than 128 KiB:\r\n\r\n  val server = Http.server\r\n    .withStreaming(true)\r\n    .withDechunkThreshold(128.kilobytes)\r\n    ...\r\n\r\n","created_at":"2018-10-21T22:47:17Z","updated_at":"2018-10-23T17:35:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b8b4396a26a357b8b4fa17f901de0008542d70d6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/twitter/finagle/pulls/740/commits","review_comments_url":"https://api.github.com/repos/twitter/finagle/pulls/740/comments","review_comment_url":"https://api.github.com/repos/twitter/finagle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/twitter/finagle/issues/740/comments","statuses_url":"https://api.github.com/repos/twitter/finagle/statuses/94eca45610e95995a31fd991e653cb6919a6305d","head":{"label":"edio:feature/unchunked_streaming","ref":"feature/unchunked_streaming","sha":"94eca45610e95995a31fd991e653cb6919a6305d","user":{"login":"edio","id":787439,"node_id":"MDQ6VXNlcjc4NzQzOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/787439?v=4","gravatar_id":"","url":"https://api.github.com/users/edio","html_url":"https://github.com/edio","followers_url":"https://api.github.com/users/edio/followers","following_url":"https://api.github.com/users/edio/following{/other_user}","gists_url":"https://api.github.com/users/edio/gists{/gist_id}","starred_url":"https://api.github.com/users/edio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edio/subscriptions","organizations_url":"https://api.github.com/users/edio/orgs","repos_url":"https://api.github.com/users/edio/repos","events_url":"https://api.github.com/users/edio/events{/privacy}","received_events_url":"https://api.github.com/users/edio/received_events","type":"User","site_admin":false},"repo":{"id":130770370,"node_id":"MDEwOlJlcG9zaXRvcnkxMzA3NzAzNzA=","name":"finagle","full_name":"edio/finagle","private":false,"owner":{"login":"edio","id":787439,"node_id":"MDQ6VXNlcjc4NzQzOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/787439?v=4","gravatar_id":"","url":"https://api.github.com/users/edio","html_url":"https://github.com/edio","followers_url":"https://api.github.com/users/edio/followers","following_url":"https://api.github.com/users/edio/following{/other_user}","gists_url":"https://api.github.com/users/edio/gists{/gist_id}","starred_url":"https://api.github.com/users/edio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edio/subscriptions","organizations_url":"https://api.github.com/users/edio/orgs","repos_url":"https://api.github.com/users/edio/repos","events_url":"https://api.github.com/users/edio/events{/privacy}","received_events_url":"https://api.github.com/users/edio/received_events","type":"User","site_admin":false},"html_url":"https://github.com/edio/finagle","description":"A fault tolerant, protocol-agnostic RPC system","fork":true,"url":"https://api.github.com/repos/edio/finagle","forks_url":"https://api.github.com/repos/edio/finagle/forks","keys_url":"https://api.github.com/repos/edio/finagle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edio/finagle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edio/finagle/teams","hooks_url":"https://api.github.com/repos/edio/finagle/hooks","issue_events_url":"https://api.github.com/repos/edio/finagle/issues/events{/number}","events_url":"https://api.github.com/repos/edio/finagle/events","assignees_url":"https://api.github.com/repos/edio/finagle/assignees{/user}","branches_url":"https://api.github.com/repos/edio/finagle/branches{/branch}","tags_url":"https://api.github.com/repos/edio/finagle/tags","blobs_url":"https://api.github.com/repos/edio/finagle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edio/finagle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edio/finagle/git/refs{/sha}","trees_url":"https://api.github.com/repos/edio/finagle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edio/finagle/statuses/{sha}","languages_url":"https://api.github.com/repos/edio/finagle/languages","stargazers_url":"https://api.github.com/repos/edio/finagle/stargazers","contributors_url":"https://api.github.com/repos/edio/finagle/contributors","subscribers_url":"https://api.github.com/repos/edio/finagle/subscribers","subscription_url":"https://api.github.com/repos/edio/finagle/subscription","commits_url":"https://api.github.com/repos/edio/finagle/commits{/sha}","git_commits_url":"https://api.github.com/repos/edio/finagle/git/commits{/sha}","comments_url":"https://api.github.com/repos/edio/finagle/comments{/number}","issue_comment_url":"https://api.github.com/repos/edio/finagle/issues/comments{/number}","contents_url":"https://api.github.com/repos/edio/finagle/contents/{+path}","compare_url":"https://api.github.com/repos/edio/finagle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edio/finagle/merges","archive_url":"https://api.github.com/repos/edio/finagle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edio/finagle/downloads","issues_url":"https://api.github.com/repos/edio/finagle/issues{/number}","pulls_url":"https://api.github.com/repos/edio/finagle/pulls{/number}","milestones_url":"https://api.github.com/repos/edio/finagle/milestones{/number}","notifications_url":"https://api.github.com/repos/edio/finagle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edio/finagle/labels{/name}","releases_url":"https://api.github.com/repos/edio/finagle/releases{/id}","deployments_url":"https://api.github.com/repos/edio/finagle/deployments","created_at":"2018-04-23T23:54:12Z","updated_at":"2018-04-23T23:54:18Z","pushed_at":"2018-10-22T21:04:23Z","git_url":"git://github.com/edio/finagle.git","ssh_url":"git@github.com:edio/finagle.git","clone_url":"https://github.com/edio/finagle.git","svn_url":"https://github.com/edio/finagle","homepage":"http://twitter.github.io/finagle","size":64082,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"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":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"twitter:develop","ref":"develop","sha":"94a4b7dea44300d083d601c8a50945d8c9aa0d4e","user":{"login":"twitter","id":50278,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUwMjc4","avatar_url":"https://avatars1.githubusercontent.com/u/50278?v=4","gravatar_id":"","url":"https://api.github.com/users/twitter","html_url":"https://github.com/twitter","followers_url":"https://api.github.com/users/twitter/followers","following_url":"https://api.github.com/users/twitter/following{/other_user}","gists_url":"https://api.github.com/users/twitter/gists{/gist_id}","starred_url":"https://api.github.com/users/twitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twitter/subscriptions","organizations_url":"https://api.github.com/users/twitter/orgs","repos_url":"https://api.github.com/users/twitter/repos","events_url":"https://api.github.com/users/twitter/events{/privacy}","received_events_url":"https://api.github.com/users/twitter/received_events","type":"Organization","site_admin":false},"repo":{"id":1007362,"node_id":"MDEwOlJlcG9zaXRvcnkxMDA3MzYy","name":"finagle","full_name":"twitter/finagle","private":false,"owner":{"login":"twitter","id":50278,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUwMjc4","avatar_url":"https://avatars1.githubusercontent.com/u/50278?v=4","gravatar_id":"","url":"https://api.github.com/users/twitter","html_url":"https://github.com/twitter","followers_url":"https://api.github.com/users/twitter/followers","following_url":"https://api.github.com/users/twitter/following{/other_user}","gists_url":"https://api.github.com/users/twitter/gists{/gist_id}","starred_url":"https://api.github.com/users/twitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twitter/subscriptions","organizations_url":"https://api.github.com/users/twitter/orgs","repos_url":"https://api.github.com/users/twitter/repos","events_url":"https://api.github.com/users/twitter/events{/privacy}","received_events_url":"https://api.github.com/users/twitter/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/twitter/finagle","description":"A fault tolerant, protocol-agnostic RPC system","fork":false,"url":"https://api.github.com/repos/twitter/finagle","forks_url":"https://api.github.com/repos/twitter/finagle/forks","keys_url":"https://api.github.com/repos/twitter/finagle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twitter/finagle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twitter/finagle/teams","hooks_url":"https://api.github.com/repos/twitter/finagle/hooks","issue_events_url":"https://api.github.com/repos/twitter/finagle/issues/events{/number}","events_url":"https://api.github.com/repos/twitter/finagle/events","assignees_url":"https://api.github.com/repos/twitter/finagle/assignees{/user}","branches_url":"https://api.github.com/repos/twitter/finagle/branches{/branch}","tags_url":"https://api.github.com/repos/twitter/finagle/tags","blobs_url":"https://api.github.com/repos/twitter/finagle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twitter/finagle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twitter/finagle/git/refs{/sha}","trees_url":"https://api.github.com/repos/twitter/finagle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twitter/finagle/statuses/{sha}","languages_url":"https://api.github.com/repos/twitter/finagle/languages","stargazers_url":"https://api.github.com/repos/twitter/finagle/stargazers","contributors_url":"https://api.github.com/repos/twitter/finagle/contributors","subscribers_url":"https://api.github.com/repos/twitter/finagle/subscribers","subscription_url":"https://api.github.com/repos/twitter/finagle/subscription","commits_url":"https://api.github.com/repos/twitter/finagle/commits{/sha}","git_commits_url":"https://api.github.com/repos/twitter/finagle/git/commits{/sha}","comments_url":"https://api.github.com/repos/twitter/finagle/comments{/number}","issue_comment_url":"https://api.github.com/repos/twitter/finagle/issues/comments{/number}","contents_url":"https://api.github.com/repos/twitter/finagle/contents/{+path}","compare_url":"https://api.github.com/repos/twitter/finagle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twitter/finagle/merges","archive_url":"https://api.github.com/repos/twitter/finagle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twitter/finagle/downloads","issues_url":"https://api.github.com/repos/twitter/finagle/issues{/number}","pulls_url":"https://api.github.com/repos/twitter/finagle/pulls{/number}","milestones_url":"https://api.github.com/repos/twitter/finagle/milestones{/number}","notifications_url":"https://api.github.com/repos/twitter/finagle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twitter/finagle/labels{/name}","releases_url":"https://api.github.com/repos/twitter/finagle/releases{/id}","deployments_url":"https://api.github.com/repos/twitter/finagle/deployments","created_at":"2010-10-19T22:10:09Z","updated_at":"2018-10-23T02:26:19Z","pushed_at":"2018-10-22T22:19:10Z","git_url":"git://github.com/twitter/finagle.git","ssh_url":"git@github.com:twitter/finagle.git","clone_url":"https://github.com/twitter/finagle.git","svn_url":"https://github.com/twitter/finagle","homepage":"http://twitter.github.io/finagle","size":66853,"stargazers_count":6740,"watchers_count":6740,"language":"Scala","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1221,"mirror_url":null,"archived":false,"open_issues_count":26,"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":1221,"open_issues":26,"watchers":6740,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/twitter/finagle/pulls/740"},"html":{"href":"https://github.com/twitter/finagle/pull/740"},"issue":{"href":"https://api.github.com/repos/twitter/finagle/issues/740"},"comments":{"href":"https://api.github.com/repos/twitter/finagle/issues/740/comments"},"review_comments":{"href":"https://api.github.com/repos/twitter/finagle/pulls/740/comments"},"review_comment":{"href":"https://api.github.com/repos/twitter/finagle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/twitter/finagle/pulls/740/commits"},"statuses":{"href":"https://api.github.com/repos/twitter/finagle/statuses/94eca45610e95995a31fd991e653cb6919a6305d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"edio"}}