#622 - Set interrupted status for findFutureList() ... (specifically the FutureList.getUnchecked() methods)

This commit is contained in:
Robin Bygrave
2016-03-25 16:49:03 +13:00
parent ab2789dd08
commit fdb2965d6e
2 changed files with 10 additions and 0 deletions
@@ -252,6 +252,8 @@ public class DefaultAutoTuneService implements AutoTuneService {
}
Thread.sleep(waitMillis);
} catch (InterruptedException e) {
// restore the interrupted status
Thread.currentThread().interrupt();
logger.warn("Error while sleeping after System.gc() request.", e);
}
}
@@ -47,8 +47,12 @@ public class QueryFutureList<T> extends BaseFuture<List<T>> implements FutureLis
public List<T> getUnchecked() {
try {
return get();
} catch (InterruptedException e) {
// restore the interrupted status (so client can check for that)
Thread.currentThread().interrupt();
throw new PersistenceException(e);
} catch (ExecutionException e) {
throw new PersistenceException(e);
}
@@ -58,8 +62,12 @@ public class QueryFutureList<T> extends BaseFuture<List<T>> implements FutureLis
public List<T> getUnchecked(long timeout, TimeUnit unit) throws TimeoutException {
try {
return get(timeout, unit);
} catch (InterruptedException e) {
// restore the interrupted status (so client can check for that)
Thread.currentThread().interrupt();
throw new PersistenceException(e);
} catch (ExecutionException e) {
throw new PersistenceException(e);
}