{"action":"created","issue":{"url":"https://api.github.com/repos/mpenet/jet/issues/12","labels_url":"https://api.github.com/repos/mpenet/jet/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/mpenet/jet/issues/12/comments","events_url":"https://api.github.com/repos/mpenet/jet/issues/12/events","html_url":"https://github.com/mpenet/jet/issues/12","id":55832212,"number":12,"title":"EofException","user":{"login":"hlship","id":52660,"avatar_url":"https://avatars.githubusercontent.com/u/52660?v=3","gravatar_id":"","url":"https://api.github.com/users/hlship","html_url":"https://github.com/hlship","followers_url":"https://api.github.com/users/hlship/followers","following_url":"https://api.github.com/users/hlship/following{/other_user}","gists_url":"https://api.github.com/users/hlship/gists{/gist_id}","starred_url":"https://api.github.com/users/hlship/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hlship/subscriptions","organizations_url":"https://api.github.com/users/hlship/orgs","repos_url":"https://api.github.com/users/hlship/repos","events_url":"https://api.github.com/users/hlship/events{/privacy}","received_events_url":"https://api.github.com/users/hlship/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2015-01-28T23:24:25Z","updated_at":"2015-01-29T23:31:04Z","closed_at":null,"body":"My handler returns a core.async channel containing a Ring response map.\r\n\r\nI've found that if my client terminates early, I start seeing exceptions in my console:\r\n\r\n```\r\n15:06:40.851 INFO  [async-thread-macro-9] e0010450-01ba-4f08-834d-e33349598d2f f.endpoint-tracking - Invoking fan.auth.resources.users/index.\r\nException in thread \"async-dispatch-17\" java.lang.Error: org.eclipse.jetty.io.EofException\r\n  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1151)\r\n  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\r\n  at java.lang.Thread.run(Thread.java:724)\r\nCaused by: org.eclipse.jetty.io.EofException\r\n  at org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:192)\r\n  at org.eclipse.jetty.io.WriteFlusher.flush(WriteFlusher.java:408)\r\n  at org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:302)\r\n  at org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:128)\r\n  at org.eclipse.jetty.server.HttpConnection$SendCallback.process(HttpConnection.java:678)\r\n  at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:246)\r\n  at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:208)\r\n  at org.eclipse.jetty.server.HttpConnection.send(HttpConnection.java:474)\r\n  at org.eclipse.jetty.server.HttpChannel.sendResponse(HttpChannel.java:771)\r\n  at org.eclipse.jetty.server.HttpChannel.write(HttpChannel.java:804)\r\n  at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:142)\r\n  at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:135)\r\n  at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:378)\r\n  at clojure.java.io$fn__6903.invoke(io.clj:297)\r\n  at clojure.lang.MultiFn.invoke(MultiFn.java:238)\r\n  at clojure.java.io$copy.doInvoke(io.clj:396)\r\n  at clojure.lang.RestFn.invoke(RestFn.java:425)\r\n  at qbits.jet.servlet$eval18046$fn__18047.invoke(servlet.clj:149)\r\n  at qbits.jet.servlet$eval17926$fn__17927$G__17917__17934.invoke(servlet.clj:100)\r\n  at qbits.jet.servlet$set_response_body_BANG_.invoke(servlet.clj:105)\r\n  at qbits.jet.servlet$set_body_BANG_.invoke(servlet.clj:207)\r\n  at qbits.jet.servlet$eval18117$fn__18119.invoke(servlet.clj:240)\r\n  at qbits.jet.servlet$eval18087$fn__18088$G__18078__18097.invoke(servlet.clj:220)\r\n  at qbits.jet.servlet$eval18123$fn__18124$fn__18125.invoke(servlet.clj:231)\r\n  at clojure.core.async.impl.channels.ManyToManyChannel$fn__3907.invoke(channels.clj:102)\r\n  at clojure.lang.AFn.run(AFn.java:22)\r\n  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\r\n  ... 2 more\r\nCaused by: java.io.IOException: Broken pipe\r\n  at sun.nio.ch.FileDispatcherImpl.write0(Native Method)\r\n  at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)\r\n  at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:94)\r\n  at sun.nio.ch.IOUtil.write(IOUtil.java:65)\r\n  at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:466)\r\n  at org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:170)\r\n  ... 28 more\r\n```\r\n\r\nI discovered this using Apache bench (the ab command), using the -t option. I would guess that after it hits its limit, it just closes the HTTP connection(s).\r\n\r\nThe UUID (f80d055a-7dc1-4823-899e-b2eee7ae8e73) is assigned to each new request.\r\n\r\nIn fact, using ab -c 20, I see 19 of these exceptions in my log; I see a burst of 19 of these exceptions, a pause of about 20 seconds, then another burst.  The UUIDs (assigned by my code as the request is received by my Ring handler) do not repeat, this means that something inside Jet and/or Jetty is retrying them.\r\n\r\nI'm tracking down a bit more about how this happens, but it really looks like it would be nice if this exception could be caught and either ignore, or perhaps written to a channel associated with the original request (i.e., so that I could write asynchronous code that would know how to recover from the response being non-deliverable).\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mpenet/jet/issues/comments/72126142","html_url":"https://github.com/mpenet/jet/issues/12#issuecomment-72126142","issue_url":"https://api.github.com/repos/mpenet/jet/issues/12","id":72126142,"user":{"login":"hlship","id":52660,"avatar_url":"https://avatars.githubusercontent.com/u/52660?v=3","gravatar_id":"","url":"https://api.github.com/users/hlship","html_url":"https://github.com/hlship","followers_url":"https://api.github.com/users/hlship/followers","following_url":"https://api.github.com/users/hlship/following{/other_user}","gists_url":"https://api.github.com/users/hlship/gists{/gist_id}","starred_url":"https://api.github.com/users/hlship/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hlship/subscriptions","organizations_url":"https://api.github.com/users/hlship/orgs","repos_url":"https://api.github.com/users/hlship/repos","events_url":"https://api.github.com/users/hlship/events{/privacy}","received_events_url":"https://api.github.com/users/hlship/received_events","type":"User","site_admin":false},"created_at":"2015-01-29T23:31:04Z","updated_at":"2015-01-29T23:31:04Z","body":"Ok, I was able to reduce it to a very small and easily reproducible case. Please see the example project and follow the notes."}}