From a70ba3f986830c552d8b5c21145e46a90edd7f40 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Wed, 19 Sep 2012 15:54:31 -0700 Subject: [PATCH] Avoid Futures.getUnchecked in DeleteAllKeysInList This masks InterruptedException. We should rework the logic in execute to unwind the stack on errors; currently we only return from the leaf method. --- .../blobstore/strategy/internal/DeleteAllKeysInList.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/blobstore/src/main/java/org/jclouds/blobstore/strategy/internal/DeleteAllKeysInList.java b/blobstore/src/main/java/org/jclouds/blobstore/strategy/internal/DeleteAllKeysInList.java index 87d58ae43d..b3221a2775 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/strategy/internal/DeleteAllKeysInList.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/strategy/internal/DeleteAllKeysInList.java @@ -22,6 +22,7 @@ import static org.jclouds.blobstore.options.ListContainerOptions.Builder.recursi import static org.jclouds.concurrent.FutureIterables.awaitCompletion; import java.util.Map; +import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; @@ -95,8 +96,11 @@ public class DeleteAllKeysInList implements ClearListStrategy, ClearContainerStr for (int i = 0; i < maxErrors; ) { // fetch partial directory listing try { - listing = Futures.getUnchecked(connection.list(containerName, options)); - } catch (RuntimeException ee) { + listing = connection.list(containerName, options).get(); + } catch (InterruptedException ie) { + Thread.currentThread().interrupt(); + break; + } catch (ExecutionException ee) { ++i; if (i == maxErrors) { throw Throwables.propagate(ee.getCause());