hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject svn commit: r664203 - in /hadoop/core/trunk: CHANGES.txt src/java/org/apache/hadoop/dfs/FSNamesystem.java
Date Fri, 06 Jun 2008 23:58:47 GMT
Author: shv
Date: Fri Jun  6 16:58:47 2008
New Revision: 664203

URL: http://svn.apache.org/viewvc?rev=664203&view=rev
Log:
HADOOP-3491. Name-node shutdown causes InterruptedException in ResolutionMonitor. Contributed
by Lohit Vijayarenu.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=664203&r1=664202&r2=664203&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Fri Jun  6 16:58:47 2008
@@ -528,6 +528,9 @@
 
     HADOOP-3509. Fix NPE in FSNamesystem.close. (Tsz Wo (Nicholas), SZE via shv)
 
+    HADOOP-3491. Name-node shutdown causes InterruptedException in 
+    ResolutionMonitor. (Lohit Vijayarenu via shv)
+
 Release 0.17.0 - 2008-05-18
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java?rev=664203&r1=664202&r2=664203&view=diff
==============================================================================
--- hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java (original)
+++ hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java Fri Jun  6 16:58:47
2008
@@ -1816,29 +1816,34 @@
     public void run() {
       try {
         while (fsRunning) {
-          List <DatanodeDescriptor> datanodes = 
-            new ArrayList<DatanodeDescriptor>(resolutionQueue.size());
-          // Block if the queue is empty
-          datanodes.add(resolutionQueue.take());
-          resolutionQueue.drainTo(datanodes);
-          List<String> dnHosts = new ArrayList<String>(datanodes.size());
-          for (DatanodeDescriptor d : datanodes) {
-            dnHosts.add(d.getName());
-          }
-          List<String> rName = dnsToSwitchMapping.resolve(dnHosts);
-          if (rName == null) {
-            LOG.error("The resolve call returned null! Using " + 
-                NetworkTopology.DEFAULT_RACK + " for some hosts");
-            rName = new ArrayList<String>(dnHosts.size());
-            for (int i = 0; i < dnHosts.size(); i++) {
-              rName.add(NetworkTopology.DEFAULT_RACK);
+          try {
+            List <DatanodeDescriptor> datanodes = 
+              new ArrayList<DatanodeDescriptor>(resolutionQueue.size());
+            // Block if the queue is empty
+            datanodes.add(resolutionQueue.take());
+            resolutionQueue.drainTo(datanodes);
+            List<String> dnHosts = new ArrayList<String>(datanodes.size());
+            for (DatanodeDescriptor d : datanodes) {
+              dnHosts.add(d.getName());
             }
-          }
-          int i = 0;
-          for (String m : rName) {
-            DatanodeDescriptor d = datanodes.get(i++); 
-            d.setNetworkLocation(m);
-            clusterMap.add(d);
+            List<String> rName = dnsToSwitchMapping.resolve(dnHosts);
+            if (rName == null) {
+              LOG.error("The resolve call returned null! Using " + 
+                  NetworkTopology.DEFAULT_RACK + " for some hosts");
+              rName = new ArrayList<String>(dnHosts.size());
+              for (int i = 0; i < dnHosts.size(); i++) {
+                rName.add(NetworkTopology.DEFAULT_RACK);
+              }
+            }
+            int i = 0;
+            for (String m : rName) {
+              DatanodeDescriptor d = datanodes.get(i++); 
+              d.setNetworkLocation(m);
+              clusterMap.add(d);
+            }
+          } catch (InterruptedException e) {
+              FSNamesystem.LOG.debug("ResolutionMonitor thread received " +
+                                     "InterruptException. " + e);
           }
         }
       } catch (Exception e) {



Mime
View raw message