curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject git commit: Avoid erroneous 'Could not cancel' warning produced by cache tasks
Date Wed, 19 Mar 2014 18:30:47 GMT
Repository: curator
Updated Branches:
  refs/heads/CURATOR-98 [created] b17e6ffb0


Avoid erroneous 'Could not cancel' warning produced by cache tasks

This closes #3


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/b17e6ffb
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/b17e6ffb
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/b17e6ffb

Branch: refs/heads/CURATOR-98
Commit: b17e6ffb0e553144ee9cbb0852a23c57ded3425f
Parents: b34aaaa
Author: Joe Littlejohn <joe.littlejohn@nokia.com>
Authored: Wed Mar 19 15:43:00 2014 +0000
Committer: randgalt <randgalt@apache.org>
Committed: Wed Mar 19 13:29:51 2014 -0500

----------------------------------------------------------------------
 .../java/org/apache/curator/utils/CloseableExecutorService.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/b17e6ffb/curator-client/src/main/java/org/apache/curator/utils/CloseableExecutorService.java
----------------------------------------------------------------------
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 5e51449..e9d2547 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 class CloseableExecutorService implements Closeable
         {
             Future<?> future = iterator.next();
             iterator.remove();
-            if ( !future.cancel(true) )
+            if ( !future.isDone() && !future.isCancelled() && !future.cancel(true)
)
             {
                 log.warn("Could not cancel " + future);
             }


Mime
View raw message