HADOOP-14214. DomainSocketWatcher::add()/delete() should not self interrupt while looping await(). Contributed by Mingliang Liu

(cherry picked from commit d35e79abc2)
This commit is contained in:
Mingliang Liu 2017-03-23 11:33:06 -07:00
parent 5e794c74e5
commit 47d3c29e30
1 changed files with 2 additions and 10 deletions

View File

@ -321,11 +321,7 @@ public final class DomainSocketWatcher implements Closeable {
toAdd.add(entry); toAdd.add(entry);
kick(); kick();
while (true) { while (true) {
try { processedCond.awaitUninterruptibly();
processedCond.await();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
if (!toAdd.contains(entry)) { if (!toAdd.contains(entry)) {
break; break;
} }
@ -347,11 +343,7 @@ public final class DomainSocketWatcher implements Closeable {
toRemove.put(sock.fd, sock); toRemove.put(sock.fd, sock);
kick(); kick();
while (true) { while (true) {
try { processedCond.awaitUninterruptibly();
processedCond.await();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
if (!toRemove.containsKey(sock.fd)) { if (!toRemove.containsKey(sock.fd)) {
break; break;
} }