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

Oleg Kalnichevski commented on HTTPCLIENT-2357:
-----------------------------------------------

[~tomaszzasada] Silly one liner, easily avoidable if we all got replaced by AI.

Please review / test the proposed fix:

[https://github.com/apache/httpcomponents-client/compare/HTTPCLIENT-2357]

Oleg

Just a remark:

This regression is also a great example that unit tests do little to help catch 
this type of regressions, as it is very tempting to adjust existing unit tests 
to match functional changes.

 

> 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
>              Labels: regresion
>             Fix For: 5.4.2, 5.5-alpha1
>
>
> 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/]`:
> ```
> {{client.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