[ 
https://issues.apache.org/jira/browse/HTTPCORE-677?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17341567#comment-17341567
 ] 

Oleg Kalnichevski commented on HTTPCORE-677:
--------------------------------------------

[~pierz]

> I don't understand why you would need such null request object but I didn't 
>dig into the code.

But please do. You will see that for the listener approach to work one would 
need to drag it all the way across multiple layers to the message parser or 
make the message parser signal an abnormal connection termination back to the 
upper layers. In which case throwing an exception is on the simplest cleanest 
ways of doing so.

> but the drawback is I won't know when the connection is really abnormally 
>closed by the client

You will get SocketException and not ConnectionCloseException in all those 
cases.

Oleg

 

 

> Suggestion: Don't throw ConnectionClosedException when connection close is 
> expected
> -----------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-677
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-677
>             Project: HttpComponents HttpCore
>          Issue Type: Improvement
>          Components: HttpCore
>    Affects Versions: 5.1
>            Reporter: Pierre N.
>            Priority: Major
>             Fix For: 5.1.1
>
>
> I'm testing apache core to replace Undertow in my web app so maybe I 
> configured badly but I noticed the server is throwing an exception in 
> ExceptionListener every time a client connection is closed.
> Is it necessary ? Is it really exceptional ? Do we really need to build a 
> full stacktrace every time a socket is closed because it happens a lot.
> The connection is expected to be closed at some point, I understand an 
> exception could be thrown if it occurs will reading the request or the 
> request body, but if the request has been read, I think it is not exceptional 
> and it shouldn't throw.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to