Skip to content
Closed
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 @@ -121,7 +121,7 @@ private static void readLedger(ClientConfiguration conf, long ledgerId, byte[] p
Thread.sleep(1000);
}
} catch (InterruptedException ie) {
// ignore
Thread.currentThread().interrupt();
} catch (Exception e) {
LOG.error("Exception in reader", e);
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public void run() {
}
} catch (InterruptedException ie) {
LOG.info("Caught interrupted exception, going away");
Thread.currentThread().interrupt();
}
}
};
Expand All @@ -162,6 +163,7 @@ public void run() {
LOG.info("Time to send first batch: {}s {}ns ", time / 1000 / 1000 / 1000, time);
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
break;
}

Expand All @@ -188,6 +190,7 @@ public void run() {
}
} catch (InterruptedException e) {
LOG.error("Interrupted while waiting", e);
Thread.currentThread().interrupt();
}
synchronized (this) {
duration = System.currentTimeMillis() - start;
Expand All @@ -198,7 +201,7 @@ public void run() {
try {
reporter.join();
} catch (InterruptedException ie) {
// ignore
Thread.currentThread().interrupt();
}
LOG.info("Finished processing in ms: " + getDuration() + " tp = " + throughput);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ public void run() {
LOG.error("I/O exception during benchmark", ioe);
} catch (InterruptedException ie) {
LOG.error("Benchmark interrupted", ie);
Thread.currentThread().interrupt();
} finally {
if (bkc != null) {
try {
Expand All @@ -188,6 +189,7 @@ public void run() {
LOG.error("Error closing bookkeeper client", bke);
} catch (InterruptedException ie) {
LOG.warn("Interrupted closing bookkeeper client", ie);
Thread.currentThread().interrupt();
}
}
}
Expand Down Expand Up @@ -280,6 +282,7 @@ public Long call() {
LOG.error("Exception in worker thread", e);
return 0L;
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
LOG.error("Exception in worker thread", ie);
return 0L;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ public void safeRun() {
}
}).get();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException("Couldn't start thread " + i, e);
} catch (ExecutionException e) {
throw new RuntimeException("Couldn't start thread " + i, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ public void start() throws Exception {
} else {
LOG.error("Failed to start org.apache.bookkeeper.http server on port {}", port, asyncResult.cause());
}
} catch (InterruptedException | ExecutionException e) {
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
LOG.error("Failed to start org.apache.bookkeeper.http server on port {}", port, ie);
} catch (ExecutionException e) {
LOG.error("Failed to start org.apache.bookkeeper.http server on port {}", port, e);
}
return false;
Expand All @@ -106,6 +109,7 @@ public void stopServer() {
try {
shutdownLatch.await();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
LOG.error("Interrupted while shutting down org.apache.bookkeeper.http server");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,7 @@ public void run() {
}
LOG.info("Journal thread(s) quit.");
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
LOG.warn("Interrupted on running journal thread : ", ie);
}
// if the journal thread quits due to shutting down, it is ok
Expand Down Expand Up @@ -1035,6 +1036,7 @@ synchronized int shutdown(int exitCode) {
registrationManager.close();
}
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
LOG.error("Interrupted during shutting down bookie : ", ie);
} catch (Exception e) {
LOG.error("Got Exception while trying to shutdown Bookie", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ BufferedLogChannel createNewLog() throws IOException {
} catch (CancellationException ce) {
throw new IOException("Task to allocate a new entry log is cancelled.", ce);
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
throw new IOException("Intrrupted when waiting a new entry log to be allocated.", ie);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ public void run() {
LOG.error("I/O exception in ForceWrite thread", ioe);
running = false;
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
LOG.error("ForceWrite thread interrupted", e);
// close is idempotent
if (null != req) {
Expand Down Expand Up @@ -1078,6 +1079,7 @@ public void run() {
} catch (IOException ioe) {
LOG.error("I/O exception in Journal thread!", ioe);
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
LOG.warn("Journal exits when shutting down", ie);
} finally {
// There could be packets queued for forceWrite on this logFile
Expand Down Expand Up @@ -1111,6 +1113,7 @@ public synchronized void shutdown() {
this.join();
LOG.info("Finished Shutting down Journal thread");
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
LOG.warn("Interrupted during shutting down journal : ", ie);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ public void gc(GarbageCleaner garbageCleaner) {
try {
zk.close();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
LOG.error("Error closing zk session", e);
}
zk = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ private void triggerFlushAndAddEntry(long ledgerId, long entryId, ByteBuf entry)
}

} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IOException("Interrupted when adding entry " + ledgerId + "@" + entryId);
} finally {
writeCacheMutex.writeLock().unlock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,10 @@ private boolean areEntriesOfLedgerStoredInTheBookie(long ledgerId, BookieSocketA
}
}
return false;
} catch (InterruptedException | ExecutionException e) {
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
throw new RuntimeException(ie);
} catch (ExecutionException e) {
if (e.getCause() != null
&& e.getCause().getClass().equals(BKException.BKNoSuchLedgerExistsException.class)) {
LOG.debug("Ledger: {} has been deleted", ledgerId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ public void getBookieInfoComplete(int rc, BookieInfo bInfo, Object ctx) {
try {
latch.await();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
LOG.error("Received InterruptedException ", e);
throw e;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ public RegistrationClient initialize(ClientConfiguration conf,
zke.fillInStackTrace();
throw zke;
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new BKInterruptedException();
}
this.ownZKHandle = true;
Expand All @@ -259,6 +260,7 @@ public void close() {
try {
zk.close();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
log.warn("Interrupted on closing zookeeper client", e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ public RegistrationManager initialize(ServerConfiguration conf,

try {
this.zk = newZookeeper(conf, listener);
} catch (InterruptedException | KeeperException | IOException e) {
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
throw new MetadataStoreException(ie);
} catch (KeeperException | IOException e) {
throw new MetadataStoreException(e);
}

Expand Down Expand Up @@ -202,6 +205,7 @@ public void close() {
try {
zk.close();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
log.warn("Interrupted on closing zookeeper client", e);
}
}
Expand Down Expand Up @@ -264,6 +268,7 @@ public void process(WatchedEvent event) {
throw new IOException("ZK exception checking and wait ephemeral znode "
+ regPath + " expired", ke);
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
log.error("Interrupted checking and wait ephemeral znode {} expired : ", regPath, ie);
throw new IOException("Interrupted checking and wait ephemeral znode "
+ regPath + " expired", ie);
Expand Down Expand Up @@ -294,6 +299,7 @@ private void doRegisterBookie(String regPath) throws BookieException {
// exit here as this is a fatal error.
throw new MetadataStoreException(ke);
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
log.error("Interrupted exception registering ephemeral Znode for Bookie!", ie);
// Throw an IOException back up. This will cause the Bookie
// constructor to error out. Alternatively, we could do a System
Expand Down Expand Up @@ -345,7 +351,10 @@ public void unregisterBookie(String bookieId, boolean readOnly) throws BookieExc
private void doUnregisterBookie(String regPath) throws BookieException {
try {
zk.delete(regPath, -1);
} catch (InterruptedException | KeeperException e) {
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
throw new MetadataStoreException(ie);
} catch (KeeperException e) {
throw new MetadataStoreException(e);
}
}
Expand Down Expand Up @@ -378,7 +387,10 @@ public void writeCookie(String bookieId,
cookieData.getValue(),
(int) ((LongVersion) cookieData.getVersion()).getLongVersion());
}
} catch (InterruptedException | KeeperException e) {
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
throw new MetadataStoreException("Interrupted writing cookie for bookie " + bookieId, ie);
} catch (KeeperException e) {
throw new MetadataStoreException("Failed to write cookie for bookie " + bookieId);
}
}
Expand Down Expand Up @@ -406,7 +418,10 @@ public void removeCookie(String bookieId, Version version) throws BookieExceptio
zk.delete(zkPath, (int) ((LongVersion) version).getLongVersion());
} catch (NoNodeException e) {
throw new CookieNotFoundException(bookieId);
} catch (InterruptedException | KeeperException e) {
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new MetadataStoreException("Interrupted deleting cookie for bookie " + bookieId, e);
} catch (KeeperException e) {
throw new MetadataStoreException("Failed to delete cookie for bookie " + bookieId);
}

Expand Down Expand Up @@ -608,6 +623,7 @@ public boolean isBookieRegistered(String bookieId) throws BookieException {
log.error("ZK exception while checking registration ephemeral znodes for BookieId: {}", bookieId, e);
throw new MetadataStoreException(e);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
log.error("InterruptedException while checking registration ephemeral znodes for BookieId: {}", bookieId,
e);
throw new MetadataStoreException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ LedgerRange getLedgerRangeByLevel(final String level1, final String level2)
* return an empty list. */
ledgerNodes = new ArrayList<>();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IOException("Error when get child nodes from zk", e);
}
NavigableSet<Long> zkActiveLedgers = ledgerListToSet(ledgerNodes, nodePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public void operationComplete(int rc, Long result) {
LOG.error("Failed to create long ledger ID path", e);
cb.operationComplete(BKException.Code.ZKException, null);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
LOG.error("Failed to create long ledger ID path", e);
cb.operationComplete(BKException.Code.InterruptedException, null);
} catch (IOException e) {
Expand Down Expand Up @@ -241,6 +242,7 @@ public void processResult(int rc, String path, Object ctx, String name) {
setLedgerIdGenPathStatus(HighOrderLedgerIdGenPathStatus.UNKNOWN);
cb.operationComplete(BKException.Code.ZKException, null);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
LOG.error("Failed to create long ledger ID path", e);
setLedgerIdGenPathStatus(HighOrderLedgerIdGenPathStatus.UNKNOWN);
cb.operationComplete(BKException.Code.InterruptedException, null);
Expand Down Expand Up @@ -318,6 +320,7 @@ public void operationComplete(int rc, Long result) {
LOG.error("Failed to create long ledger ID path", e);
cb.operationComplete(BKException.Code.ZKException, null);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
LOG.error("Failed to create long ledger ID path", e);
cb.operationComplete(BKException.Code.InterruptedException, null);
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ public synchronized void block() {
wait();
}
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ void suspendProcessing() {
try {
Thread.sleep(10);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
});
Expand Down Expand Up @@ -406,6 +407,7 @@ void shutdown() {
try {
eventLoopGroup.shutdownGracefully(0, 10, TimeUnit.MILLISECONDS).await();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
/// OK
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ public void run() {
Thread.sleep(watchInterval);
} catch (InterruptedException ie) {
// do nothing
Thread.currentThread().interrupt();
}
if (!isBookieRunning()) {
shutdown();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ protected void processPacket() {
errorCode = BookieProtocol.EOK;
}
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
LOG.error("Interrupting fence read entry {}", read, ie);
errorCode = BookieProtocol.EIO;
data.release();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ private void initialize(ServerConfiguration conf, ZooKeeper zkc)
throw new UnavailableException(
"Exception while initializing Auditor", ioe);
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
throw new UnavailableException(
"Interrupted while initializing Auditor", ie);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ public void run() {
try {
zkc.delete(myVote, -1);
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
LOG.warn("InterruptedException while deleting myVote: " + myVote,
ie);
} catch (KeeperException ke) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ public void run() {
try {
Thread.sleep(watchInterval);
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
break;
}
// If any one service not running, then shutdown peer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ private static void waitBackOffTime(long backoffMs) {
try {
Thread.sleep(backoffMs);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public void close() {
try {
ticketRefreshThread.join(10000);
} catch (InterruptedException exit) {
Thread.currentThread().interrupt();
if (LOG.isDebugEnabled()) {
LOG.debug("interrupted while waiting for TGT reresh thread to stop", exit);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public void close() {
try {
ticketRefreshThread.join(10000);
} catch (InterruptedException exit) {
Thread.currentThread().interrupt();
if (LOG.isDebugEnabled()) {
LOG.debug("interrupted while waiting for TGT reresh thread to stop", exit);
}
Expand Down
Loading