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

Thomas Klambauer commented on HTTPCLIENT-2378:
----------------------------------------------

Hi Oleg!

So you mean for the default client that this is the expected behavior? and that 
the fix is to use something like this:
{code:java}
ManagedHttpClientConnectionFactory factr = 
ManagedHttpClientConnectionFactory.builder().responseOutOfOrderStrategy(MonitoringResponseOutOfOrderStrategy.INSTANCE).build();
BasicHttpClientConnectionManager manager = 
BasicHttpClientConnectionManager.create(null, factr);
final CloseableHttpClient client = HttpClients.
       custom().setConnectionManager(manager).build();
 {code}
?

> Big request bodies and early server reponse yield SocketException instead of 
> response
> -------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-2378
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2378
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient (classic)
>    Affects Versions: 5.5
>            Reporter: Thomas Klambauer
>            Priority: Minor
>         Attachments: httpclient-bug.zip
>
>
> Hi! We have a problem similar/same as HTTPCLIENT-2093.
> it seems not fixed with the other issue.
> Basically, eg jetty responds early with an HTTP404 if a URL is not found,  
> while the HTTPclient is still sending the data if it has a big body, and the 
> server for 404 also closes the connection immediately.
> the immediate connection close yields a broken pipe socketexception in the 
> execute httpclient method.
> So depending on timing / http request body size, the result is either the 
> server status code (eg 404) or an exception.
> best case would be to check for already returned http response when the 
> connection is closed (as the RFC reference in HTTPCLIENT-2093 mentions) - and 
> return normally from the execute method?
> attaching a reproducer.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to