spring-cloud-openfeign
spring-cloud-openfeign copied to clipboard
HTTP connection leak when using feign.Response and apache HTTP client Connection pool
Describe the bug I would like to report the following behavior: when using feign.Response in @FeignClient with Transfer-Encoding: chunked response header, the HTTP connection is not getting released back to the HTTP connection pool causing HTTP connection leak. You can find code samples which are reproducing the issue.
My setup is: Java 21 Spring Boot 3.4.6
Sample Sample client: https://github.com/emilnkrastev/client-feign Sample target: https://github.com/emilnkrastev/target-feign Sample DEBUG messages: 2025-05-27T14:46:57.087+03:00 DEBUG 15672 --- [client-feign] [nio-8081-exec-5] h.i.i.PoolingHttpClientConnectionManager : ex-0000000003 endpoint lease request (3 MINUTES) [route: {}->[http://localhost:8080]][total available: 0; route allocated: 2 of 50; total allocated: 2 of 200] 2025-05-27T14:46:57.087+03:00 DEBUG 15672 --- [client-feign] [nio-8081-exec-5] h.i.i.PoolingHttpClientConnectionManager : ex-0000000003 endpoint leased [route: {}->[http://localhost:8080]][total available: 0; route allocated: 3 of 50; total allocated: 3 of 200] The HTTP connections are constantly growing without connection release messages