HBASE-10652 Fix incorrect handling of IE that restores current thread's interrupt status within while/for loops in rpc (Feng Honghua)
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1573937 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
fbf2cc5377
commit
84f48f87f8
|
@ -154,11 +154,18 @@ public class SimpleRpcScheduler implements RpcScheduler {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void consumerLoop(BlockingQueue<CallRunner> myQueue) {
|
private void consumerLoop(BlockingQueue<CallRunner> myQueue) {
|
||||||
while (running) {
|
boolean interrupted = false;
|
||||||
try {
|
try {
|
||||||
CallRunner task = myQueue.take();
|
while (running) {
|
||||||
task.run();
|
try {
|
||||||
} catch (InterruptedException e) {
|
CallRunner task = myQueue.take();
|
||||||
|
task.run();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
interrupted = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
if (interrupted) {
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue