You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2019/01/10 12:37:50 UTC

[httpcomponents-client] branch master updated: HTTPCLIENT-1958: PoolingHttpClientConnectionManager to throw ExecutionException in case of a lease operation cancellation instead of InterruptedException (fixed previous commit)

This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git


The following commit(s) were added to refs/heads/master by this push:
     new 7824d98  HTTPCLIENT-1958: PoolingHttpClientConnectionManager to throw ExecutionException in case of a lease operation cancellation instead of InterruptedException (fixed previous commit)
7824d98 is described below

commit 7824d98d0ca8aa4bed14d70c01c544ac544d4170
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Tue Jan 8 12:04:17 2019 +0100

    HTTPCLIENT-1958: PoolingHttpClientConnectionManager to throw ExecutionException in case of a lease operation cancellation instead of InterruptedException
    (fixed previous commit)
---
 .../hc/client5/http/impl/io/PoolingHttpClientConnectionManager.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/PoolingHttpClientConnectionManager.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/PoolingHttpClientConnectionManager.java
index faf9a5f..0865ea2 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/PoolingHttpClientConnectionManager.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/PoolingHttpClientConnectionManager.java
@@ -28,6 +28,7 @@ package org.apache.hc.client5.http.impl.io;
 
 import java.io.IOException;
 import java.util.Set;
+import java.util.concurrent.CancellationException;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeoutException;
@@ -272,7 +273,7 @@ public class PoolingHttpClientConnectionManager
                 try {
                     poolEntry = leaseFuture.get(timeout.getDuration(), timeout.getTimeUnit());
                     if (poolEntry == null || leaseFuture.isCancelled()) {
-                        throw new InterruptedException();
+                        throw new ExecutionException(new CancellationException("Operation cancelled"));
                     }
                 } catch (final TimeoutException ex) {
                     leaseFuture.cancel(true);