[
https://issues.apache.org/jira/browse/HTTPCORE-777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17932982#comment-17932982
]
Oleksandr Kriuchenko edited comment on HTTPCORE-777 at 3/6/25 12:33 PM:
------------------------------------------------------------------------
[~olegk] thank you very much for looking into this! My expectation was that the
future would eventually complete with some failure. But you are right - I've
modified the test to keep the http client open until the test completion to
make it more clear. Still it shows the same behavior. Could you please take a
look again?
https://github.com/oleksandr-kriuchenko-lohika/httpcore5-issue/blob/main/src/test/java/ApacheHttpClient5TransportIT.java
{code:java}
/**
* This test never completes
*/
@Test
public void connectionResetIsHandledSuccessfully()
throws IOException, ExecutionException, InterruptedException {
ClientAndServer dbMockServer = createProxyMockServer("httpbin.org", 80, 1080);
dbMockServer
.when(request(), Times.unlimited())
.error(HttpError.error().withDropConnection(true));
CloseableHttpAsyncClient httpClient = getHttpClient();
Future<SimpleHttpResponse> future = sendRequest(httpClient, "httpbin.org",
1080, "/");
assertThrows(ExecutionException.class, future::get);
httpClient.close();
}{code}
was (Author: JIRAUSER308941):
[~olegk] thank you very much for looking into this! My expectation was that the
future would eventually complete with some failure. But you are right - I've
modified the test to keep the http client open until the test completion to
make it more clear. Still it shows the same behavior. Could you please take a
look again?
https://github.com/apache/httpcomponents-client/blob/5.4.x/httpclient5/src/test/java/org/apache/hc/client5/http/examples/AsyncClientHttpExchange.java
{code:java}
/**
* This test never completes
*/
@Test
public void connectionResetIsHandledSuccessfully()
throws IOException, ExecutionException, InterruptedException {
ClientAndServer dbMockServer = createProxyMockServer("httpbin.org", 80, 1080);
dbMockServer
.when(request(), Times.unlimited())
.error(HttpError.error().withDropConnection(true));
CloseableHttpAsyncClient httpClient = getHttpClient();
Future<SimpleHttpResponse> future = sendRequest(httpClient, "httpbin.org",
1080, "/");
assertThrows(ExecutionException.class, future::get);
httpClient.close();
}{code}
> CloseableHttpAsyncClient.execute hangs forever upon connection reset
> --------------------------------------------------------------------
>
> Key: HTTPCORE-777
> URL: https://issues.apache.org/jira/browse/HTTPCORE-777
> Project: HttpComponents HttpCore
> Issue Type: Bug
> Components: HttpCore
> Affects Versions: 5.3.3
> Reporter: Oleksandr Kriuchenko
> Priority: Major
>
> There seems to be an issue with async http client request execution:
> if connection is closed during request execution then the future
> returned by the CloseableHttpAsyncClient.execute never completes.
> Please find a test setup to reproduce the issue (along with the
> conditions description under which the issue reproduces) in
> [https://github.com/oleksandr-kriuchenko-lohika/httpcore5-issue]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]