mirror of
https://github.com/apache/jclouds.git
synced 2025-02-16 15:08:28 +00:00
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.
This commit is contained in:
parent
28d766b9df
commit
ad87c596d9
@ -22,6 +22,7 @@ import static org.jclouds.blobstore.options.ListContainerOptions.Builder.recursi
|
|||||||
import static org.jclouds.concurrent.FutureIterables.awaitCompletion;
|
import static org.jclouds.concurrent.FutureIterables.awaitCompletion;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
@ -95,8 +96,11 @@ public class DeleteAllKeysInList implements ClearListStrategy, ClearContainerStr
|
|||||||
for (int i = 0; i < maxErrors; ) {
|
for (int i = 0; i < maxErrors; ) {
|
||||||
// fetch partial directory listing
|
// fetch partial directory listing
|
||||||
try {
|
try {
|
||||||
listing = Futures.getUnchecked(connection.list(containerName, options));
|
listing = connection.list(containerName, options).get();
|
||||||
} catch (RuntimeException ee) {
|
} catch (InterruptedException ie) {
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
|
break;
|
||||||
|
} catch (ExecutionException ee) {
|
||||||
++i;
|
++i;
|
||||||
if (i == maxErrors) {
|
if (i == maxErrors) {
|
||||||
throw Throwables.propagate(ee.getCause());
|
throw Throwables.propagate(ee.getCause());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user