{"action":"created","issue":{"url":"https://api.github.com/repos/netty/netty/issues/3448","labels_url":"https://api.github.com/repos/netty/netty/issues/3448/labels{/name}","comments_url":"https://api.github.com/repos/netty/netty/issues/3448/comments","events_url":"https://api.github.com/repos/netty/netty/issues/3448/events","html_url":"https://github.com/netty/netty/issues/3448","id":58808764,"number":3448,"title":"Get rid of Http2StreamRemovalPolicy","user":{"login":"nmittler","id":6493296,"avatar_url":"https://avatars.githubusercontent.com/u/6493296?v=3","gravatar_id":"","url":"https://api.github.com/users/nmittler","html_url":"https://github.com/nmittler","followers_url":"https://api.github.com/users/nmittler/followers","following_url":"https://api.github.com/users/nmittler/following{/other_user}","gists_url":"https://api.github.com/users/nmittler/gists{/gist_id}","starred_url":"https://api.github.com/users/nmittler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmittler/subscriptions","organizations_url":"https://api.github.com/users/nmittler/orgs","repos_url":"https://api.github.com/users/nmittler/repos","events_url":"https://api.github.com/users/nmittler/events{/privacy}","received_events_url":"https://api.github.com/users/nmittler/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/netty/netty/labels/improvement","name":"improvement","color":"0052cc"}],"state":"open","locked":false,"assignee":{"login":"nmittler","id":6493296,"avatar_url":"https://avatars.githubusercontent.com/u/6493296?v=3","gravatar_id":"","url":"https://api.github.com/users/nmittler","html_url":"https://github.com/nmittler","followers_url":"https://api.github.com/users/nmittler/followers","following_url":"https://api.github.com/users/nmittler/following{/other_user}","gists_url":"https://api.github.com/users/nmittler/gists{/gist_id}","starred_url":"https://api.github.com/users/nmittler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmittler/subscriptions","organizations_url":"https://api.github.com/users/nmittler/orgs","repos_url":"https://api.github.com/users/nmittler/repos","events_url":"https://api.github.com/users/nmittler/events{/privacy}","received_events_url":"https://api.github.com/users/nmittler/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/netty/netty/milestones/84","html_url":"https://github.com/netty/netty/milestones/4.1.0.Final","labels_url":"https://api.github.com/repos/netty/netty/milestones/84/labels","id":561880,"number":84,"title":"4.1.0.Final","description":null,"creator":{"login":"trustin","id":173918,"avatar_url":"https://avatars.githubusercontent.com/u/173918?v=3","gravatar_id":"","url":"https://api.github.com/users/trustin","html_url":"https://github.com/trustin","followers_url":"https://api.github.com/users/trustin/followers","following_url":"https://api.github.com/users/trustin/following{/other_user}","gists_url":"https://api.github.com/users/trustin/gists{/gist_id}","starred_url":"https://api.github.com/users/trustin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trustin/subscriptions","organizations_url":"https://api.github.com/users/trustin/orgs","repos_url":"https://api.github.com/users/trustin/repos","events_url":"https://api.github.com/users/trustin/events{/privacy}","received_events_url":"https://api.github.com/users/trustin/received_events","type":"User","site_admin":false},"open_issues":51,"closed_issues":44,"state":"open","created_at":"2014-02-07T08:42:42Z","updated_at":"2015-02-25T04:08:35Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2015-02-24T21:30:53Z","updated_at":"2015-02-25T18:04:36Z","closed_at":null,"body":"The `DefaultHttp2StreamRemovalPolicy` by default waits 5 seconds after a stream has been closed before removing it from the connection.  The reason for this is to support the following case from the HTTP2 spec (From [Section 5.1](https://tools.ietf.org/html/draft-ietf-httpbis-http2-17#section-5.1)):\r\n\r\n    \"WINDOW_UPDATE or RST_STREAM frames can be received in this state\r\n     for a short period after a DATA or HEADERS frame containing an\r\n     END_STREAM flag is sent.  Until the remote peer receives and\r\n     processes RST_STREAM or the frame bearing the END_STREAM flag, it\r\n     might send frames of these types.  Endpoints MUST ignore\r\n     WINDOW_UPDATE or RST_STREAM frames received in this state, though\r\n     endpoints MAY choose to treat frames that arrive a significant\r\n     time after sending END_STREAM as a connection error\r\n     of type PROTOCOL_ERROR.\"\r\n\r\nThese cases don't really seem to warrant the extra complexity that DefaultHttp2StreamRemovalPolicy introduces.  It would be better to just always ignore WINDOW_UPDATE and RST_STREAM for non-existent streams.  This way we can always remove the streams as soon as they're closed to avoid potential memory leaks."},"comment":{"url":"https://api.github.com/repos/netty/netty/issues/comments/76019381","html_url":"https://github.com/netty/netty/issues/3448#issuecomment-76019381","issue_url":"https://api.github.com/repos/netty/netty/issues/3448","id":76019381,"user":{"login":"Scottmitch","id":7562868,"avatar_url":"https://avatars.githubusercontent.com/u/7562868?v=3","gravatar_id":"","url":"https://api.github.com/users/Scottmitch","html_url":"https://github.com/Scottmitch","followers_url":"https://api.github.com/users/Scottmitch/followers","following_url":"https://api.github.com/users/Scottmitch/following{/other_user}","gists_url":"https://api.github.com/users/Scottmitch/gists{/gist_id}","starred_url":"https://api.github.com/users/Scottmitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Scottmitch/subscriptions","organizations_url":"https://api.github.com/users/Scottmitch/orgs","repos_url":"https://api.github.com/users/Scottmitch/repos","events_url":"https://api.github.com/users/Scottmitch/events{/privacy}","received_events_url":"https://api.github.com/users/Scottmitch/received_events","type":"User","site_admin":false},"created_at":"2015-02-25T18:04:36Z","updated_at":"2015-02-25T18:04:36Z","body":"@nmittler - I think we are mostly in agreement and we can work out the details in the PR.\r\n\r\n> I think for now we can just use connection.remove().lastStreamCreated() ... this would maintain the current behavior. \r\n\r\nThis is not obvious to me yet. [onWindowUpdateRead](https://github.com/netty/netty/blob/master/codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2ConnectionDecoder.java#L531) and [onRstStreamRead](https://github.com/netty/netty/blob/master/codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2ConnectionDecoder.java#L388) both use `connection.requireStream(...)`.  This will change to support the ignore \"frames for streams that don't exist but are lower than the stream id that would be sent in a go away frame\".  The user currently has some control over when errors get returned in these situations via the \"removal\".  If we force `connection.remote().lastStreamCreated()` we may be taking this control away.  I think this is a good default but the question is should we be providing an extension point as we introduce these changes."}}