{"action":"created","issue":{"url":"https://api.github.com/repos/eclipse/jetty.project/issues/730","repository_url":"https://api.github.com/repos/eclipse/jetty.project","labels_url":"https://api.github.com/repos/eclipse/jetty.project/issues/730/labels{/name}","comments_url":"https://api.github.com/repos/eclipse/jetty.project/issues/730/comments","events_url":"https://api.github.com/repos/eclipse/jetty.project/issues/730/events","html_url":"https://github.com/eclipse/jetty.project/issues/730","id":165755142,"number":730,"title":"\"Slow\" client causes IllegalStateException","user":{"login":"poutsma","id":330665,"avatar_url":"https://avatars.githubusercontent.com/u/330665?v=3","gravatar_id":"","url":"https://api.github.com/users/poutsma","html_url":"https://github.com/poutsma","followers_url":"https://api.github.com/users/poutsma/followers","following_url":"https://api.github.com/users/poutsma/following{/other_user}","gists_url":"https://api.github.com/users/poutsma/gists{/gist_id}","starred_url":"https://api.github.com/users/poutsma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poutsma/subscriptions","organizations_url":"https://api.github.com/users/poutsma/orgs","repos_url":"https://api.github.com/users/poutsma/repos","events_url":"https://api.github.com/users/poutsma/events{/privacy}","received_events_url":"https://api.github.com/users/poutsma/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-15T10:18:42Z","updated_at":"2016-07-15T11:17:04Z","closed_at":null,"body":"We have come across an issue with the Servlet 3.1 async support in Jetty 9.3.10.v20160621. When a (non-Jetty) HTTP client is \"slow\" in sending the request body, Jetty will end up in an illegal state, with the following exception:\r\n\r\n```\r\njava.lang.IllegalStateException: state=ASYNC\r\n\tat org.eclipse.jetty.server.HttpOutput.run(HttpOutput.java:944)\r\n\tat org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1286)\r\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:427)\r\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)\r\n\tat org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)\r\n\tat org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)\r\n\tat org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)\r\n\tat org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)\r\n\tat org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)\r\n\tat org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)\r\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)\r\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\n```\r\n\r\nIt seems a bit strange that a slow client has effect on the servlet output, but the issue is 100% reproducible in our tests, on both Mac OS and Linux.\r\n\r\nHere is a sample project that demonstrates the issue: https://github.com/poutsma/jetty-async-issue.\r\n\r\nThat project contains a `ServerDriver` that starts a Jetty Server with the `AsyncIssueServlet`, which uses the `ReadListener` and `WriteListener` API to consume the input. It also contains a `ClientDriver` which uses `HttpURLConnection` to send data. The only thing non-standard in both is the `Thread.sleep` statement [in the client](https://github.com/poutsma/jetty-async-issue/blob/master/src/main/java/org/example/ClientDriver.java#L60), making it slower in sending out its request. Both driver classes have a `main` method that starts them up.\r\n\r\nLet me know if you need any further information."},"comment":{"url":"https://api.github.com/repos/eclipse/jetty.project/issues/comments/232926089","html_url":"https://github.com/eclipse/jetty.project/issues/730#issuecomment-232926089","issue_url":"https://api.github.com/repos/eclipse/jetty.project/issues/730","id":232926089,"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-07-15T11:17:04Z","updated_at":"2016-07-15T11:17:04Z","body":"However, I also think we have a bug, standby for analysis."}}
{"actor":{"display_login":"sbordet"}}