svn merge -c 1408779 FIXES: HDFS-4181. LeaseManager tries to double remove and prints extra messages (Kihwal Lee via daryn)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1408780 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Daryn Sharp 2012-11-13 15:31:17 +00:00
parent 57657df4dc
commit 6ef30552db
2 changed files with 14 additions and 6 deletions

View File

@ -1697,6 +1697,9 @@ Release 0.23.5 - UNRELEASED
HDFS-3990. NN's health report has severe performance problems (daryn) HDFS-3990. NN's health report has severe performance problems (daryn)
HDFS-4181. LeaseManager tries to double remove and prints extra messages
(Kihwal Lee via daryn)
BUG FIXES BUG FIXES
HDFS-3829. TestHftpURLTimeouts fails intermittently with JDK7 (Trevor HDFS-3829. TestHftpURLTimeouts fails intermittently with JDK7 (Trevor

View File

@ -135,7 +135,9 @@ public class LeaseManager {
synchronized void removeLease(Lease lease, String src) { synchronized void removeLease(Lease lease, String src) {
sortedLeasesByPath.remove(src); sortedLeasesByPath.remove(src);
if (!lease.removePath(src)) { if (!lease.removePath(src)) {
LOG.error(src + " not found in lease.paths (=" + lease.paths + ")"); if (LOG.isDebugEnabled()) {
LOG.debug(src + " not found in lease.paths (=" + lease.paths + ")");
}
} }
if (!lease.hasPath()) { if (!lease.hasPath()) {
@ -440,11 +442,14 @@ public class LeaseManager {
oldest.getPaths().toArray(leasePaths); oldest.getPaths().toArray(leasePaths);
for(String p : leasePaths) { for(String p : leasePaths) {
try { try {
if(fsnamesystem.internalReleaseLease(oldest, p, HdfsServerConstants.NAMENODE_LEASE_HOLDER)) { boolean completed = fsnamesystem.internalReleaseLease(oldest, p,
LOG.info("Lease recovery for " + p + " is complete. File closed."); HdfsServerConstants.NAMENODE_LEASE_HOLDER);
removing.add(p); if (LOG.isDebugEnabled()) {
} else { if (completed) {
LOG.info("Started block recovery " + p + " lease " + oldest); LOG.debug("Lease recovery for " + p + " is complete. File closed.");
} else {
LOG.debug("Started block recovery " + p + " lease " + oldest);
}
} }
} catch (IOException e) { } catch (IOException e) {
LOG.error("Cannot release the path " + p + " in the lease " LOG.error("Cannot release the path " + p + " in the lease "