HBASE-10521 Add handling for swallowed InterruptedException thrown by Thread.sleep in RpcServer (Feng Honghua)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1570212 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
nkeywal 2014-02-20 15:03:17 +00:00
parent f20938d8ec
commit 1d52d528c9
1 changed files with 17 additions and 9 deletions

View File

@ -584,10 +584,8 @@ public class RpcServer implements RpcServerInterface {
key = null;
}
} catch (InterruptedException e) {
if (running) { // unexpected -- log it
LOG.info(getName() + ": unexpectedly interrupted: " +
StringUtils.stringifyException(e));
}
LOG.debug("Interrupted while sleeping");
return;
} catch (IOException ex) {
LOG.error(getName() + ": error in Reader", ex);
}
@ -702,13 +700,19 @@ public class RpcServer implements RpcServerInterface {
LOG.warn(getName() + ": OutOfMemoryError in server select", e);
closeCurrentConnection(key, e);
cleanupConnections(true);
try { Thread.sleep(60000); } catch (Exception ignored) {}
try {
Thread.sleep(60000);
} catch (InterruptedException ex) {
LOG.debug("Interrupted while sleeping");
return;
}
}
} catch (Exception e) {
closeCurrentConnection(key, e);
}
cleanupConnections(false);
}
LOG.info(getName() + ": stopping");
synchronized (this) {
@ -859,7 +863,6 @@ public class RpcServer implements RpcServerInterface {
private void doRunLoop() {
long lastPurgeTime = 0; // last check for old calls.
while (running) {
try {
waitPending(); // If a channel is being registered, wait.
@ -921,7 +924,12 @@ public class RpcServer implements RpcServerInterface {
// some thread(s) a chance to finish
//
LOG.warn(getName() + ": OutOfMemoryError in server select", e);
try { Thread.sleep(60000); } catch (Exception ignored) {}
try {
Thread.sleep(60000);
} catch (InterruptedException ex) {
LOG.debug("Interrupted while sleeping");
return;
}
}
} catch (Exception e) {
LOG.warn(getName() + ": exception in Responder " +