HADOOP-11648. Set DomainSocketWatcher thread name explicitly. Contributed by Liang Xie.

(cherry picked from commit 74a4754d1c)
This commit is contained in:
Tsuyoshi Ozawa 2015-03-05 16:05:44 +09:00
parent ac874764d5
commit f805d48b19
6 changed files with 15 additions and 6 deletions

View File

@ -227,6 +227,9 @@ Release 2.7.0 - UNRELEASED
HADOOP-11658. Externalize io.compression.codecs property. HADOOP-11658. Externalize io.compression.codecs property.
(Kai Zheng via aajisaka) (Kai Zheng via aajisaka)
HADOOP-11648. Set DomainSocketWatcher thread name explicitly.
(Liang Xie via ozawa)
OPTIMIZATIONS OPTIMIZATIONS
HADOOP-11323. WritableComparator#compare keeps reference to byte array. HADOOP-11323. WritableComparator#compare keeps reference to byte array.

View File

@ -238,7 +238,8 @@ public final class DomainSocketWatcher implements Closeable {
*/ */
private boolean kicked = false; private boolean kicked = false;
public DomainSocketWatcher(int interruptCheckPeriodMs) throws IOException { public DomainSocketWatcher(int interruptCheckPeriodMs, String src)
throws IOException {
if (loadingFailureReason != null) { if (loadingFailureReason != null) {
throw new UnsupportedOperationException(loadingFailureReason); throw new UnsupportedOperationException(loadingFailureReason);
} }
@ -246,8 +247,9 @@ public final class DomainSocketWatcher implements Closeable {
this.interruptCheckPeriodMs = interruptCheckPeriodMs; this.interruptCheckPeriodMs = interruptCheckPeriodMs;
notificationSockets = DomainSocket.socketpair(); notificationSockets = DomainSocket.socketpair();
watcherThread.setDaemon(true); watcherThread.setDaemon(true);
watcherThread.setUncaughtExceptionHandler( watcherThread.setName(src + " DomainSocketWatcher");
new Thread.UncaughtExceptionHandler() { watcherThread
.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@Override @Override
public void uncaughtException(Thread thread, Throwable t) { public void uncaughtException(Thread thread, Throwable t) {
LOG.error(thread + " terminating on unexpected exception", t); LOG.error(thread + " terminating on unexpected exception", t);

View File

@ -195,7 +195,7 @@ public class TestDomainSocketWatcher {
private DomainSocketWatcher newDomainSocketWatcher(int interruptCheckPeriodMs) private DomainSocketWatcher newDomainSocketWatcher(int interruptCheckPeriodMs)
throws Exception { throws Exception {
DomainSocketWatcher watcher = new DomainSocketWatcher( DomainSocketWatcher watcher = new DomainSocketWatcher(
interruptCheckPeriodMs); interruptCheckPeriodMs, getClass().getSimpleName());
watcher.watcherThread.setUncaughtExceptionHandler( watcher.watcherThread.setUncaughtExceptionHandler(
new Thread.UncaughtExceptionHandler() { new Thread.UncaughtExceptionHandler() {
@Override @Override

View File

@ -407,6 +407,9 @@ Release 2.7.0 - UNRELEASED
HDFS-7746. Add a test randomly mixing append, truncate and snapshot HDFS-7746. Add a test randomly mixing append, truncate and snapshot
operations. (szetszwo) operations. (szetszwo)
HADOOP-11648. Set DomainSocketWatcher thread name explicitly.
(Liang Xie via ozawa)
OPTIMIZATIONS OPTIMIZATIONS
HDFS-7454. Reduce memory footprint for AclEntries in NameNode. HDFS-7454. Reduce memory footprint for AclEntries in NameNode.

View File

@ -176,7 +176,7 @@ public class ShortCircuitRegistry {
if (dswLoadingFailure != null) { if (dswLoadingFailure != null) {
throw new IOException(dswLoadingFailure); throw new IOException(dswLoadingFailure);
} }
watcher = new DomainSocketWatcher(interruptCheck); watcher = new DomainSocketWatcher(interruptCheck, "datanode");
enabled = true; enabled = true;
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("created new ShortCircuitRegistry with interruptCheck=" + LOG.debug("created new ShortCircuitRegistry with interruptCheck=" +

View File

@ -412,7 +412,8 @@ public class DfsClientShmManager implements Closeable {
private final DomainSocketWatcher domainSocketWatcher; private final DomainSocketWatcher domainSocketWatcher;
DfsClientShmManager(int interruptCheckPeriodMs) throws IOException { DfsClientShmManager(int interruptCheckPeriodMs) throws IOException {
this.domainSocketWatcher = new DomainSocketWatcher(interruptCheckPeriodMs); this.domainSocketWatcher = new DomainSocketWatcher(interruptCheckPeriodMs,
"client");
} }
public Slot allocSlot(DatanodeInfo datanode, DomainPeer peer, public Slot allocSlot(DatanodeInfo datanode, DomainPeer peer,