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/12/11 11:12:27 UTC

[httpcomponents-core] 03/03: Interrupt the current thread when catching and not rethrowing InterruptedException

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

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

commit 4e412fe51818d4b8f2b678a0338088ecd5c065a7
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Wed Dec 11 12:01:49 2019 +0100

    Interrupt the current thread when catching and not rethrowing InterruptedException
---
 .../main/java/org/apache/hc/core5/http/impl/bootstrap/HttpRequester.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/bootstrap/HttpRequester.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/bootstrap/HttpRequester.java
index 4e617d5..f618c4e 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/bootstrap/HttpRequester.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/bootstrap/HttpRequester.java
@@ -321,6 +321,7 @@ public class HttpRequester implements ConnPoolControl<HttpHost>, ModalCloseable
         try {
             poolEntry = leaseFuture.get(timeout.getDuration(), timeout.getTimeUnit());
         } catch (final InterruptedException ex) {
+            Thread.currentThread().interrupt();
             throw new InterruptedIOException(ex.getMessage());
         } catch (final ExecutionException ex) {
             throw new HttpException("Unexpected failure leasing connection", ex);