I may have spoken too soon; it looks like perhaps there _is_ another
connection leak in 5.0.3. Fortunately, the user supplied a patch which he
claims fixes it. Oleg, does this patch make sense to you?
diff --git
src/main/java/org/apache/hc/client5/http/impl/classic/InternalExecRuntime.java
src/main/java/org/apache/hc/client5/http/impl/classic/InternalExecRuntime.java
index a344265..9911f29 100644
---
src/main/java/org/apache/hc/client5/http/impl/classic/InternalExecRuntime.java
+++
src/main/java/org/apache/hc/client5/http/impl/classic/InternalExecRuntime.java
@@ -115,6 +115,12 @@ class InternalExecRuntime implements ExecRuntime,
Cancellable {
reusable = connectionEndpoint.isConnected();
if (cancellableDependency != null) {
cancellableDependency.setDependency(this);
+ // if the dependency was already cancelled
setDependency will trigger cancellation
+ // and in that case we shouldn't acquire successfully
+ if (cancellableDependency.isCancelled()) {
+ this.cancel();
+ throw new RequestFailedException("Request
aborted");
+ }
}
if (log.isDebugEnabled()) {
log.debug("{} acquired endpoint {}", id,
ConnPoolSupport.getId(connectionEndpoint));