Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Invalid
-
None
-
None
-
None
-
None
Description
If you create a code with a reusable httpclient and then call execute as in the example with the following code. The http connection will be falsely closed.
private PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(); httpClient = HttpClients.custom() .setConnectionManager(connectionManager) .build(); try (CloseableHttpResponse response = httpClient.execute(new HttpGet(enetLink), context)) { ..... }
The reason being that we have:
CloseableHttpResponse: public void close() throws IOException { if (this.connHolder != null) { this.connHolder.close(); } } ConnectionHolder: public void close() throws IOException { releaseConnection(false); }
Just created the correction, which is attached as patch.