From 420ca78e252918e79ca5fe3e398d24f22b475b18 Mon Sep 17 00:00:00 2001 From: Joe Littlejohn Date: Wed, 19 Mar 2014 15:43:00 +0000 Subject: [PATCH] Avoid erroneous 'Could not cancel' warning produced by cache tasks --- .../java/org/apache/curator/utils/CloseableExecutorService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curator-client/src/main/java/org/apache/curator/utils/CloseableExecutorService.java b/curator-client/src/main/java/org/apache/curator/utils/CloseableExecutorService.java index 5e51449ca8..e9d25472c9 100644 --- a/curator-client/src/main/java/org/apache/curator/utils/CloseableExecutorService.java +++ b/curator-client/src/main/java/org/apache/curator/utils/CloseableExecutorService.java @@ -148,7 +148,7 @@ public void close() { Future future = iterator.next(); iterator.remove(); - if ( !future.cancel(true) ) + if ( !future.isDone() && !future.isCancelled() && !future.cancel(true) ) { log.warn("Could not cancel " + future); }