Author: szetszwo
Date: Mon Dec 29 18:54:06 2008
New Revision: 730034
URL: http://svn.apache.org/viewvc?rev=730034&view=rev
Log:
HADOOP-4951. Lease monitor should acquire the LeaseManager lock but not the
Monitor lock. (szetszwo)
Modified:
hadoop/core/branches/branch-0.19/CHANGES.txt
hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java
Modified: hadoop/core/branches/branch-0.19/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/CHANGES.txt?rev=730034&r1=730033&r2=730034&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.19/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.19/CHANGES.txt Mon Dec 29 18:54:06 2008
@@ -1111,6 +1111,9 @@
HADOOP-1980. 'dfsadmin -safemode enter' should prevent the namenode from
leaving safemode automatically. (shv)
+ HADOOP-4951. Lease monitor should acquire the LeaseManager lock but not the
+ Monitor lock. (szetszwo)
+
Release 0.18.2 - 2008-11-03
BUG FIXES
Modified:
hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java
URL:
http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java?rev=730034&r1=730033&r2=730034&view=diff
==============================================================================
---
hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java
(original)
+++
hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java
Mon Dec 29 18:54:06 2008
@@ -358,42 +358,40 @@
}
}
}
+ }
- /** Check the leases beginning from the oldest. */
- private synchronized void checkLeases() {
- for(; sortedLeases.size() > 0; ) {
- final Lease oldest = sortedLeases.first();
- if (!oldest.expiredHardLimit()) {
- return;
- }
+ /** Check the leases beginning from the oldest. */
+ private synchronized void checkLeases() {
+ for(; sortedLeases.size() > 0; ) {
+ final Lease oldest = sortedLeases.first();
+ if (!oldest.expiredHardLimit()) {
+ return;
+ }
- LOG.info(name + ": Lease " + oldest + " has expired hard limit");
+ LOG.info("Lease " + oldest + " has expired hard limit");
- final List<StringBytesWritable> removing = new
ArrayList<StringBytesWritable>();
- for(StringBytesWritable p : oldest.getPaths()) {
- try {
- fsnamesystem.internalReleaseLease(oldest, p.getString());
- } catch (IOException e) {
- LOG.error("In " + name + ", cannot release the path " + p
- + " in the lease " + oldest, e);
- removing.add(p);
- }
+ final List<StringBytesWritable> removing = new
ArrayList<StringBytesWritable>();
+ for(StringBytesWritable p : oldest.getPaths()) {
+ try {
+ fsnamesystem.internalReleaseLease(oldest, p.getString());
+ } catch (IOException e) {
+ LOG.error("Cannot release the path "+p+" in the lease "+oldest, e);
+ removing.add(p);
}
+ }
- for(StringBytesWritable p : removing) {
- try {
- removeLease(oldest, p.getString());
- } catch (IOException e) {
- LOG.error("In " + name + ", cannot removeLease: oldest="
- + oldest + ", p=" + p, e);
- }
+ for(StringBytesWritable p : removing) {
+ try {
+ removeLease(oldest, p.getString());
+ } catch (IOException e) {
+ LOG.error("Cannot removeLease: oldest=" + oldest + ", p=" + p, e);
}
}
}
}
/** {...@inheritdoc} */
- public String toString() {
+ public synchronized String toString() {
return getClass().getSimpleName() + "= {"
+ "\n leases=" + leases
+ "\n sortedLeases=" + sortedLeases