{"action":"created","issue":{"url":"https://api.github.com/repos/eclipse/jetty.project/issues/825","repository_url":"https://api.github.com/repos/eclipse/jetty.project","labels_url":"https://api.github.com/repos/eclipse/jetty.project/issues/825/labels{/name}","comments_url":"https://api.github.com/repos/eclipse/jetty.project/issues/825/comments","events_url":"https://api.github.com/repos/eclipse/jetty.project/issues/825/events","html_url":"https://github.com/eclipse/jetty.project/pull/825","id":170151743,"number":825,"title":"Changes for Issue #824","user":{"login":"sbordet","id":414681,"avatar_url":"https://avatars.githubusercontent.com/u/414681?v=3","gravatar_id":"","url":"https://api.github.com/users/sbordet","html_url":"https://github.com/sbordet","followers_url":"https://api.github.com/users/sbordet/followers","following_url":"https://api.github.com/users/sbordet/following{/other_user}","gists_url":"https://api.github.com/users/sbordet/gists{/gist_id}","starred_url":"https://api.github.com/users/sbordet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbordet/subscriptions","organizations_url":"https://api.github.com/users/sbordet/orgs","repos_url":"https://api.github.com/users/sbordet/repos","events_url":"https://api.github.com/users/sbordet/events{/privacy}","received_events_url":"https://api.github.com/users/sbordet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-09T12:18:05Z","updated_at":"2016-08-09T12:48:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/eclipse/jetty.project/pulls/825","html_url":"https://github.com/eclipse/jetty.project/pull/825","diff_url":"https://github.com/eclipse/jetty.project/pull/825.diff","patch_url":"https://github.com/eclipse/jetty.project/pull/825.patch"},"body":"Introduced new method HttpChannelState.asyncError() to be called in\r\ncase of asynchronous errors, i.e. those errors that do not happen in\r\nthe HttpChannel.handle() loop.\r\n\r\nImplemented HTTP/2 callbacks to call HttpChannelState.asyncError()\r\nand plug in the existing error handling mechanism."},"comment":{"url":"https://api.github.com/repos/eclipse/jetty.project/issues/comments/238542161","html_url":"https://github.com/eclipse/jetty.project/pull/825#issuecomment-238542161","issue_url":"https://api.github.com/repos/eclipse/jetty.project/issues/825","id":238542161,"user":{"login":"sbordet","id":414681,"avatar_url":"https://avatars.githubusercontent.com/u/414681?v=3","gravatar_id":"","url":"https://api.github.com/users/sbordet","html_url":"https://github.com/sbordet","followers_url":"https://api.github.com/users/sbordet/followers","following_url":"https://api.github.com/users/sbordet/following{/other_user}","gists_url":"https://api.github.com/users/sbordet/gists{/gist_id}","starred_url":"https://api.github.com/users/sbordet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbordet/subscriptions","organizations_url":"https://api.github.com/users/sbordet/orgs","repos_url":"https://api.github.com/users/sbordet/repos","events_url":"https://api.github.com/users/sbordet/events{/privacy}","received_events_url":"https://api.github.com/users/sbordet/received_events","type":"User","site_admin":false},"created_at":"2016-08-09T12:48:48Z","updated_at":"2016-08-09T12:48:48Z","body":"@gregw please review this PR.\r\n\r\nWith HTTP/2 there are errors that may happen asynchronously, i.e. not related to the `HttpChannel.handle()` loop.\r\nTypical case is when the client sends a request, but then sends a RST_STREAM for that request, which may arrive on the server before the request being dispatched, or while the request is being dispatched, and during (or not) async I/O.\r\nHowever, the client may also close, or the server may idle timeout. All these events are asynchronous with request to the request processing, so we needed an entry point in `HttpChannelState` for async errors.\r\n\r\nI introduced `HttpChannelState.asyncError()` to change the state in a way that an error is handled by `HttpChannel` at the first occasion.\r\nIf the state is `ASYNC_WAIT`, then it calls `HttpChannel.handle()` to actually handle the error.\r\n\r\nThe only case I'm not 100% sure is when the state is `IDLE`, which may happen when the request headers arrived, but we are delaying the call to the application until we get the first content.\r\nI think in this case we still have nothing to do because the application has not been invoked yet.\r\n\r\nIf the server idle timeout expires between the HEADERS and the first DATA frame, what should we do ? For example, HTTP/2 recycles channels, but the `complete` event on the channel won't be fired.\r\nPerhaps we should force the `complete` event in this case ?\r\n\r\nTo cover the case for when the error arrives when the request is dispatched, `HttpChannelOverHTTP2.onFailure()` invokes `onEarlyEOF()` (to signal the error event to readers), and then calls `HttpChannelState.asyncError()`.\r\nThe write side is covered by the fact that either the stream is reset (so we will fail the write callback and the application gets an exception), or the connection is physically closed (and so the application gets an exception)."}}
{"actor":{"display_login":"sbordet"}}