Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ public Result next() {
count--;
return result;
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ public Map<String,String> modifyProperties(final Consumer<Map<String,String>> ma
"Unable to modify instance properties for because of concurrent modification");
retry.waitForNextAttempt(log, "Modify instance properties");
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
} finally {
Expand Down Expand Up @@ -349,6 +350,9 @@ public List<ActiveCompaction> getActiveCompactions()
try {
ret.addAll(future.get());
} catch (InterruptedException | ExecutionException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
if (e.getCause() instanceof ThriftSecurityException) {
ThriftSecurityException tse = (ThriftSecurityException) e.getCause();
throw new AccumuloSecurityException(tse.user, tse.code, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ public Map<String,String> modifyProperties(final String namespace,
+ " because of concurrent modification");
retry.waitForNextAttempt(log, "Modify namespace properties for " + namespace);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ public void addSplits(String tableName, SortedSet<Text> partitionKeys)
}
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
} finally {
executor.shutdown();
Expand Down Expand Up @@ -1065,6 +1066,7 @@ public Map<String,String> modifyProperties(String tableName,
+ " because of concurrent modification");
retry.waitForNextAttempt(log, "modify table properties for " + tableName);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
} finally {
Expand Down Expand Up @@ -1956,6 +1958,7 @@ public Locations locate(String tableName, Collection<Range> ranges)
String.format("locating tablets in table %s(%s) for %d ranges", tableName, tableId,
rangeList.size()));
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
locator.invalidateCache();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ public TabletServerBatchReaderIterator(ClientContext context, TableId tableId, S
try {
resultsQueue.put(entries);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
if (TabletServerBatchReaderIterator.this.queryThreadPool.isShutdown()) {
log.debug("Failed to add Batch Scan result", e);
} else {
Expand Down Expand Up @@ -215,6 +216,7 @@ public boolean hasNext() {
batchIterator = batch.iterator();
return batch != LAST_BATCH;
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}
Expand Down Expand Up @@ -288,6 +290,7 @@ private void binRanges(TabletLocator tabletLocator, List<Range> ranges,
try {
retry.waitForNextAttempt(log, "binRanges retry failures");
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}

Expand Down Expand Up @@ -491,6 +494,7 @@ public void run() {
try {
resultsQueue.put(LAST_BATCH);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
fatalException = e;
if (!resultsQueue.offer(LAST_BATCH)) {
log.debug("Could not add to result queue after seeing fatalException",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ private void waitRTE(WaitCondition condition) {
wait();
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}
Expand Down Expand Up @@ -1074,6 +1075,7 @@ public void close() throws ThriftSecurityException {
try {
cancelSession();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IllegalStateException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ static <T> Optional<T> waitUntil(Supplier<Optional<T>> condition, Duration maxWa
retry.waitForNextAttempt(log, String.format(
"For tableId %s scan server selector is waiting for '%s'", tableId, description));
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}

Expand Down Expand Up @@ -550,6 +551,7 @@ public static List<KeyValue> scan(ClientContext context, ScanState scanState, Du

return results;
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
TraceUtil.setException(parent, ex, true);
throw new AccumuloException(ex);
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ void shutdown() {
try {
checkThread.join();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ public void load()
try {
retry.waitForNextAttempt(log, String.format("bulk import to %s(%s)", tableName, tableId));
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
log.info(ae.getMessage() + ". Retrying bulk import to " + tableName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ public boolean checkGlobalLock(ZooReaderWriter zk, ServiceLockPath zLockManagerP
return false;
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
System.err.println("ERROR: Could not read manager lock, not running" + e.getMessage());
if (this.exitOnError) {
System.exit(1);
Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/org/apache/accumulo/core/fate/Fate.java
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ public void shutdown(boolean wait) {
try {
executor.awaitTermination(1, SECONDS);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IllegalStateException(e);
}
}
Expand Down
11 changes: 11 additions & 0 deletions core/src/main/java/org/apache/accumulo/core/fate/ZooStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ public long reserve() {
}
}
} catch (InterruptedException | KeeperException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new RuntimeException(e);
}
}
Expand All @@ -251,6 +254,7 @@ public void reserve(long tid) {
try {
this.wait(1000);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}
Expand Down Expand Up @@ -451,6 +455,7 @@ public TStatus waitForStatusChange(long tid, EnumSet<TStatus> expected) {
try {
this.wait(5000);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}
Expand Down Expand Up @@ -567,6 +572,9 @@ public List<ReadOnlyRepo<T>> getStack(long tid) {
} catch (KeeperException.NoNodeException e) {
return Collections.emptyList();
} catch (KeeperException | InterruptedException e1) {
if (e1 instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new RuntimeException(e1);
}

Expand All @@ -587,6 +595,9 @@ public List<ReadOnlyRepo<T>> getStack(long tid) {
// children changed so start over
continue outer;
} catch (KeeperException | InterruptedException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new RuntimeException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,9 @@ public void process(WatchedEvent event) {
LOG.debug("[{}] Renewed watch on prior node {}", vmLockPrefix, nodeToWatch);
}
} catch (KeeperException | InterruptedException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
lw.failedToAcquireLock(
new Exception("Failed to renew watch on prior node: " + nodeToWatch, e));
}
Expand Down Expand Up @@ -575,6 +578,9 @@ public void process(WatchedEvent event) {
determineLockOwnership(lw);

} catch (KeeperException | InterruptedException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
lw.failedToAcquireLock(e);
}
}
Expand Down Expand Up @@ -915,6 +921,9 @@ public boolean verifyLockAtSource() {
try {
return null != this.zooKeeper.exists(lockPath, false);
} catch (KeeperException | InterruptedException | RuntimeException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
LOG.error("Error verfiying lock at {}", lockPath, e);
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public synchronized void waitForChange() {
LOG.info("{} lock held by someone else, waiting for a change in state", serviceName);
wait();
} catch (InterruptedException e) {
// empty
Thread.currentThread().interrupt();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ public T retry() {
log.warn("Zookeeper error, will retry", e);
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
log.info("Zookeeper error, will retry", e);
} catch (ConcurrentModificationException e) {
log.debug("Zookeeper was modified, will retry");
Expand All @@ -272,6 +273,7 @@ public T retry() {
// do not hold lock while sleeping
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
log.debug("Wait in retry() was interrupted.", e);
}
LockSupport.parkNanos(sleepTime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ static ZooKeeper connect(String host, int timeout, String scheme, byte[] auth, W
zooKeeper.close();
zooKeeper = null;
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
log.warn("interrupted", e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ public LruBlockCache(final LruBlockCacheConfiguration conf) {
try {
Thread.sleep(10);
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
throw new RuntimeException(ex);
}
}
Expand Down Expand Up @@ -533,7 +534,7 @@ public void run() {
try {
this.wait();
} catch (InterruptedException e) {
// empty
Thread.currentThread().interrupt();
}
}
LruBlockCache cache = this.cache.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,9 @@ private static TabletMetadata getRootMetadata(ClientContext ctx,
byte[] bytes = zooReader.getData(path);
return new RootTabletMetadata(new String(bytes, UTF_8)).toTabletMetadata();
} catch (InterruptedException | KeeperException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new RuntimeException(e);
}
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ public void open() throws TTransportException {
return null;
});
} catch (IOException | InterruptedException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new RuntimeException(e);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ public Client getConnection(ClientContext context) {
ZooReader reader = context.getZooReader();
replCoordinatorAddr = new String(reader.getData(zkPath), UTF_8);
} catch (KeeperException | InterruptedException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
LOG.error("Could not fetch remote coordinator port", e);
return null;
}
Expand Down Expand Up @@ -109,6 +112,7 @@ public Client getConnectionWithRetry(ClientContext context) {
try {
Thread.sleep(attempts * 250L);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}
Expand All @@ -130,6 +134,7 @@ public <R> R execute(ClientContext context, Exec<R,Client> exec)
try {
Thread.sleep(100);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new AccumuloException(e);
}
} catch (ThriftSecurityException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ private static void waitForZooKeeperClientThreads() {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
log.error("{}", e.getMessage(), e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public static void sleep(long millis) {
try {
Thread.sleep(millis);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
log.error("{}", e.getMessage(), e);
}
}
Expand All @@ -57,6 +58,7 @@ public static void sleepUninterruptibly(long sleepFor, TimeUnit unit) {
NANOSECONDS.sleep(remainingNanos);
return;
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
interrupted = true;
remainingNanos = end - System.nanoTime();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ public static List<RunningCompaction> getCompactionsRunningOnCompactors(ClientCo
results.add(new RunningCompaction(job, compactorAddress, rcf.getQueue()));
}
} catch (InterruptedException | ExecutionException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new RuntimeException(e);
}
});
Expand Down Expand Up @@ -272,6 +275,9 @@ public static List<RunningCompaction> getCompactionsRunningOnCompactors(ClientCo
runningIds.add(ceid);
}
} catch (InterruptedException | ExecutionException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new RuntimeException(e);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ private static boolean checkTaskFailed(ScheduledFuture<?> future,
// the list of critical tasks
return true;
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
// current thread was interrupted waiting for get to return, which in theory,
// shouldn't happen since the task is done.
LOG.info("Interrupted while waiting to check on scheduled background task.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ static void tryToGc() {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
fail("Thread interrupted while waiting for GC");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ public void testMultipleReaders() throws IOException {
try {
pool.awaitTermination(Long.MAX_VALUE, MILLISECONDS);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
e.printStackTrace();
}
}
Expand Down
Loading