HDFS-4840. ReplicationMonitor gets NPE during shutdown. Contributed by Kihwal Lee.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1489634 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Kihwal Lee 2013-06-04 21:43:08 +00:00
parent af65d6f80e
commit c4382e7565
2 changed files with 10 additions and 3 deletions

View File

@ -561,6 +561,8 @@ Release 2.1.0-beta - UNRELEASED
HDFS-4382. Fix typo MAX_NOT_CHANGED_INTERATIONS. (Ted Yu via suresh)
HDFS-4840. ReplicationMonitor gets NPE during shutdown. (kihwal)
BREAKDOWN OF HDFS-347 SUBTASKS AND RELATED JIRAS
HDFS-4353. Encapsulate connections to peers in Peer and PeerServer classes.

View File

@ -3094,10 +3094,15 @@ public void run() {
computeDatanodeWork();
processPendingReplications();
Thread.sleep(replicationRecheckInterval);
} catch (InterruptedException ie) {
LOG.warn("ReplicationMonitor thread received InterruptedException.", ie);
break;
} catch (Throwable t) {
if (!namesystem.isRunning()) {
LOG.info("Stopping ReplicationMonitor.");
if (!(t instanceof InterruptedException)) {
LOG.info("ReplicationMonitor received an exception"
+ " while shutting down.", t);
}
break;
}
LOG.fatal("ReplicationMonitor thread received Runtime exception. ", t);
terminate(1, t);
}