[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-2357?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tomasz Zasada updated HTTPCLIENT-2357:
--------------------------------------
    Description: 
HttpClient is not releasing connections when a proxy returns status codes != 
200.

*How to reproduce:*
 # Set up a proxy server 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|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.

  was:
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|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.


> 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-beta1, 5.4, 5.4.1
>            Reporter: Tomasz Zasada
>            Priority: Major
>
> HttpClient is not releasing connections when a proxy returns status codes != 
> 200.
> *How to reproduce:*
>  # Set up a proxy server 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|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: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to