Closed jfendler closed 8 years ago
Can you copy-n-paste the exceptions -- I'd like to see the stacktraces.
On Thu, Jun 2, 2016 at 5:04 AM, Jens Fendler notifications@github.com wrote:
Hi @jjlauer https://github.com/jjlauer,
with ninja-undertow (instead of using jetty), I get plenty of "Broken Pipe" exceptions, apparently whenever a server response is not fully consumed by the client. With jetty I had a similar effect, but only when serving large file entities (see Google groups https://groups.google.com/forum/#!topic/ninja-framework/z12l8Izh7EM). Since using undertow the same basic issue seems to occur rather frequently with a lot of requests.
I couldn't really find this issue described anywhere in the undertow forums, so I'm not sure if it's an undertow, or a ninja-undertow issue. I'll try and build a test case for this, since I do believe this is not how it should be. Even if the root cause (IOException while trying to write to the response stream) is thrown by undertow for a reason, I don't believe anybody would want these specific exceptions to show up in production logs (clients close connections all the time..).
Do you have any thoughts or ideas on how to approach this best (perhaps something more elegant than just catching and ignoring the exception)?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fizzed/ninja-undertow/issues/3, or mute the thread https://github.com/notifications/unsubscribe/AAjwApDF-1lXleM6Ir14sZeN6ma3P_2Xks5qHpy3gaJpZM4IsWIa .
I thought so.... and added them to the post right after I first saved it. Please have a look at the issue page.
I occasionally see the broken pipe too -- I'm happy undertow doesn't swallow it, but I agree we can make those safer to handle. I generally run HTTPS w/ undertow and that causes a different set of exceptions to be thrown as well.
Seems like issues similar to this exist for WildFly (which is the main container that uses Undertow). https://issues.jboss.org/browse/WFLY-3722 -- So i don't think ninja-undertow is doing anything special to cause it. Sounds like undertow's main author, Stuart, is recommending those get swallowed and logged as debug in WildFly. So I suppose we could do something similar. Two ideas. 1) Implement a generalized approach in Ninja to help handle exceptions while writing output. That would benefit Jetty as well. Maybe make the handler bound via guice so users can customize. 2) Implement a wrapped OutputStream from ninja-undertow that helps swallow & log the specific exceptions. So rather than return the OutputStream directly from undertow's exchange, that gets a wrapped version that can handle the various IOExceptions we want to swallow up.
On Thu, Jun 2, 2016 at 7:36 AM, Jens Fendler notifications@github.com wrote:
I thought so.... and added them to the post right after I first saved it. Please have a look at the issue page.
Kind regards, Jens Fendler -------- Original message --------From: Joe Lauer < notifications@github.com> Date: 2016/06/02 12:22 (GMT+01:00) To: fizzed/ninja-undertow ninja-undertow@noreply.github.com Cc: Jens Fendler jf@jensfendler.com, Author author@noreply.github.com Subject: Re: [fizzed/ninja-undertow] Exceptions thrown when client closes the connection (#3) Can you copy-n-paste the exceptions -- I'd like to see the stacktraces.
On Thu, Jun 2, 2016 at 5:04 AM, Jens Fendler notifications@github.com
wrote:
Hi @jjlauer https://github.com/jjlauer,
with ninja-undertow (instead of using jetty), I get plenty of "Broken
Pipe" exceptions, apparently whenever a server response is not fully
consumed by the client.
With jetty I had a similar effect, but only when serving large file
entities (see Google groups
https://groups.google.com/forum/#!topic/ninja-framework/z12l8Izh7EM).
Since using undertow the same basic issue seems to occur rather frequently
with a lot of requests.
I couldn't really find this issue described anywhere in the undertow
forums, so I'm not sure if it's an undertow, or a ninja-undertow issue.
I'll try and build a test case for this, since I do believe this is not how
it should be. Even if the root cause (IOException while trying to write to
the response stream) is thrown by undertow for a reason, I don't believe
anybody would want these specific exceptions to show up in production logs
(clients close connections all the time..).
Do you have any thoughts or ideas on how to approach this best (perhaps
something more elegant than just catching and ignoring the exception)?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/fizzed/ninja-undertow/issues/3, or mute the thread
< https://github.com/notifications/unsubscribe/AAjwApDF-1lXleM6Ir14sZeN6ma3P_2Xks5qHpy3gaJpZM4IsWIa
.
— You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fizzed/ninja-undertow/issues/3#issuecomment-223266653, or mute the thread https://github.com/notifications/unsubscribe/AAjwAsNag6X62C-RzMh6KZ9CWwu7haxkks5qHsBAgaJpZM4IsWIa .
I'm definitely in favour of handling it in ninja, rather than in a specific server module. I'd assume all HTTP servers will act similarly (i.e. simply throw such exceptions), so if Ninja is prepared to swallow and silently log to DEBUG only that'd be the cleanest approach IMHO. Unless you get to this first, I'll dig into the respective Ninja code and see what I can come up with.. Thanks for your input.
Hi @jjlauer,
with ninja-undertow (instead of using jetty), I get plenty of "Broken Pipe" exceptions, apparently whenever a server response is not fully consumed by the client. With jetty I had a similar effect, but only when serving large file entities (see Google groups). Since using undertow the same basic issue seems to occur rather frequently with a lot of requests.
I couldn't really find this issue described anywhere in the undertow forums, so I'm not sure if it's an undertow, or a ninja-undertow issue. I'll try and build a test case for this, since I do believe this is not how it should be. Even if the root cause (IOException while trying to write to the response stream) is thrown by undertow for a reason, I don't believe anybody would want these specific exceptions to show up in production logs (clients close connections all the time..).
Do you have any thoughts or ideas on how to approach this best (perhaps something more elegant than just catching and ignoring the exception)?
Here's the stack trace I get when this happens: