Tomasz Zasada created HTTPCLIENT-2357:
-----------------------------------------
Summary: HttpClient is not releasing connections when a proxy
returns status codes != 200
Key: HTTPCLIENT-2357
URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2357
Project: HttpComponents HttpClient
Issue Type: Bug
Components: HttpClient (classic)
Affects Versions: 5.4.1, 5.4, 5.4-beta1
Reporter: Tomasz Zasada
HttpClient is not releasing connections when a proxy returns status codes !=
200.
*How to reproduce:*
# Set up a proxy that will respond with e.g.: {{403 Forbidden}} status code.
It can simply be an HTTP server that responds with `{{{}HTTP/1.1 403
Forbidden{}}}`.
# Set up HttpClient v5 to use the proxy:
# ```
{{CloseableHttpClient client = HttpClients.custom()}}
{{.setProxy(HttpHost.create(PROXY_URL))}}
{{.build();}}
```
# Set DEBUG log level for
{{org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager}} to
see lease/release logs.
# Make requests to e.g.: `https://atlassian.com`:
```
clientV5.execute(new HttpPost("https://atlassian.com"), response ->
response);```
# Connections are not released, eventually making the client reach the total
limit.
The faulty code was introduced in `215571a0bdb08849dcee315d456f4ecc93b89863`
commit in {{org.apache.hc.client5.http.impl.classic.ConnectExec}} class.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]