You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by sz...@apache.org on 2008/12/30 03:24:15 UTC

svn commit: r730030 - in /hadoop/core/trunk: CHANGES.txt src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java

Author: szetszwo
Date: Mon Dec 29 18:24:15 2008
New Revision: 730030

URL: http://svn.apache.org/viewvc?rev=730030&view=rev
Log:
HADOOP-4951. Lease monitor should acquire the LeaseManager lock but not the Monitor lock. (szetszwo)

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=730030&r1=730029&r2=730030&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Mon Dec 29 18:24:15 2008
@@ -1628,6 +1628,9 @@
     HADOOP-1980. 'dfsadmin -safemode enter' should prevent the namenode from
     leaving safemode automatically. (shv & Raghu Angadi)
 
+    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/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java?rev=730030&r1=730029&r2=730030&view=diff
==============================================================================
--- hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java (original)
+++ hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java Mon Dec 29 18:24:15 2008
@@ -354,37 +354,36 @@
         }
       }
     }
-    
-    /** 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<String> removing = new ArrayList<String>();
-        for(String p : oldest.getPaths()) {
-          try {
-            fsnamesystem.internalReleaseLease(oldest, p);
-          } catch (IOException e) {
-            LOG.error("In " + name + ", cannot release the path " + p
-                + " in the lease " + oldest, e);
-            removing.add(p);
-          }
+      final List<String> removing = new ArrayList<String>();
+      for(String p : oldest.getPaths()) {
+        try {
+          fsnamesystem.internalReleaseLease(oldest, p);
+        } catch (IOException e) {
+          LOG.error("Cannot release the path "+p+" in the lease "+oldest, e);
+          removing.add(p);
         }
+      }
 
-        for(String p : removing) {
-          removeLease(oldest, p);
-        }
+      for(String p : removing) {
+        removeLease(oldest, p);
       }
     }
   }
 
   /** {@inheritDoc} */
-  public String toString() {
+  public synchronized String toString() {
     return getClass().getSimpleName() + "= {"
         + "\n leases=" + leases
         + "\n sortedLeases=" + sortedLeases