HDFS-3860. HeartbeatManager#Monitor may wrongly hold the writelock of namesystem. Contributed by Jing Zhao.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1378228 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Aaron Myers 2012-08-28 17:01:38 +00:00
parent 54d4630d9b
commit 8d724dd8b9
2 changed files with 6 additions and 3 deletions

View File

@ -687,6 +687,9 @@ Branch-2 ( Unreleased changes )
HDFS-3856. TestHDFSServerPorts failure is causing surefire fork failure.
(eli)
HDFS-3860. HeartbeatManager#Monitor may wrongly hold the writelock of
namesystem. (Jing Zhao via atm)
BREAKDOWN OF HDFS-3042 SUBTASKS
HDFS-2185. HDFS portion of ZK-based FailoverController (todd)

View File

@ -223,10 +223,10 @@ class HeartbeatManager implements DatanodeStatistics {
if (!allAlive) {
// acquire the fsnamesystem lock, and then remove the dead node.
namesystem.writeLock();
if (namesystem.isInSafeMode()) {
return;
}
try {
if (namesystem.isInSafeMode()) {
return;
}
synchronized(this) {
dm.removeDeadDatanode(dead);
}