[ https://issues.apache.org/jira/browse/HTTPCLIENT-2184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17442900#comment-17442900 ]
Carter Kozak commented on HTTPCLIENT-2184: ------------------------------------------ I've done a code dive, built a reproducer, and believe I understand the problem. There was a regression introduced by 5164a4e7b4 (HTTPCLIENT-2170) which changes the behavior of streamed response entities such that closing the entity (rather than the response object itself) no longer returns the connection to the connection pool, however this only impacts requests with non-repeatable entities (and possibly TRACE requests which receive a response body due to an exceptional response status or non-standard server). I've added a failing test and a fix in https://github.com/apache/httpcomponents-client/pull/325 We may want to prioritize releasing a fix for this, as it's fairly confusing and subtle, and in most cases will leave connection pools permanently unusable. > Leased Connection Leak after upgrade to 5.1.1 > --------------------------------------------- > > Key: HTTPCLIENT-2184 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2184 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: HttpClient (classic) > Affects Versions: 5.1.1 > Reporter: Carter Kozak > Priority: Critical > Attachments: 2021-11-11_1095x517_screen.png > > Time Spent: 10m > Remaining Estimate: 0h > > Unfortunately I haven't had a chance to build a local reproducer yet, nor > have I had a chance to profile a system experiencing this failure – I intend > to add additional data to this ticket later on as I debug. > I do have a system deployed where the issue does not reproduce on 5.1, but I > can redeploy only changing the httpcomponents-client jar to 5.1.1 (no other > transitive dependency changes, etc) and the leak appears. This should rule > out bad application code as a root cause, I also have metrics which capture > any time a response is not closed, which reports zero leaks in both cases. > I have attached a graph of my connection pool leased-connections metric, the > blue line in the middle represents the first version which took > httpcomponents-client 5.1.1, where previously leased connections sat right > around zero. There's a short gap after the blue line ends where we rolled > back to the previous release, followed by a few smaller successful attempts > to reproduce the issue resulting in large sets of leased connections. -- This message was sent by Atlassian Jira (v8.20.1#820001) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org