From d35e79abc2fee7153a6168e6088f100de59d8c81 Mon Sep 17 00:00:00 2001 From: Mingliang Liu Date: Thu, 23 Mar 2017 11:33:06 -0700 Subject: [PATCH] HADOOP-14214. DomainSocketWatcher::add()/delete() should not self interrupt while looping await(). Contributed by Mingliang Liu --- .../apache/hadoop/net/unix/DomainSocketWatcher.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/unix/DomainSocketWatcher.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/unix/DomainSocketWatcher.java index ad2fbfb288..e1bcf7e20c 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/unix/DomainSocketWatcher.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/unix/DomainSocketWatcher.java @@ -321,11 +321,7 @@ public void add(DomainSocket sock, Handler handler) { toAdd.add(entry); kick(); while (true) { - try { - processedCond.await(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } + processedCond.awaitUninterruptibly(); if (!toAdd.contains(entry)) { break; } @@ -347,11 +343,7 @@ public void remove(DomainSocket sock) { toRemove.put(sock.fd, sock); kick(); while (true) { - try { - processedCond.await(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } + processedCond.awaitUninterruptibly(); if (!toRemove.containsKey(sock.fd)) { break; }