[GRADLE-3518] HTTP requests block forever because of leaking pooled connections Created: 01/Aug/16  Updated: 29/Aug/16  Resolved: 29/Aug/16

Status: Resolved
Project: Gradle
Affects Version/s: 2.14.1
Fix Version/s: 3.1-rc-1

Type: Bug
Reporter: Lari Hotari Assignee: Stefan Wolf
Resolution: Fixed Votes: 0

Issue Links:
Related to GRADLE-3424 HTTP requests fail due to reuse of st... Resolved
Related to GRADLE-3517 ConnectionPoolTimeoutException when u... Resolved


Forum issue: https://discuss.gradle.org/t/gradle-2-12-stalls-forever-trying-to-resolve-dependencies-if-anything-had-to-be-fetched-via-http/16448

It looks like Gradle doesn't properly use Apache HttpClient 4.3+ API that introduced CloseableHttpResponse.
It's recommended to use org.apache.http.client.utils.HttpClientUtils.closeQuietly(CloseableHttpResponse) in a try-finally clause to make sure the resources aren't leaked. HttpClientUtils.closeQuietly replaces the usage of EntityUtils.consume as well.

The Apache HttpClient quickstart states it clearly:

the user MUST call CloseableHttpResponse#close() from a finally clause.

Comment by Lari Hotari [ 01/Aug/16 ]

Apache HttpClient was upgraded from 4.2.x to 4.4.x while fixing GRADLE-3250 .

Generated at Wed Jun 30 12:50:53 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.