From 569d7b3ecc416d90b2dcf4d321f1c8232c95e19c Mon Sep 17 00:00:00 2001 From: javanna Date: Tue, 19 Jul 2016 17:32:12 +0200 Subject: [PATCH] notify the listener if the request gets cancelled --- .../rest/src/main/java/org/elasticsearch/client/RestClient.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/rest/src/main/java/org/elasticsearch/client/RestClient.java b/client/rest/src/main/java/org/elasticsearch/client/RestClient.java index 0ca4a4e94ce..d8d45b3a3fd 100644 --- a/client/rest/src/main/java/org/elasticsearch/client/RestClient.java +++ b/client/rest/src/main/java/org/elasticsearch/client/RestClient.java @@ -58,6 +58,7 @@ import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; @@ -346,6 +347,7 @@ public final class RestClient implements Closeable { @Override public void cancelled() { + listener.onDefinitiveFailure(new ExecutionException("request was cancelled", null)); } }); }