浏览代码

HADOOP-294. Fix a bug where the conditions for retrying after errors in the DFS client were reversed. Contributed by Owen.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@413122 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 19 年之前
父节点
当前提交
3ab5cc64ad
共有 3 个文件被更改,包括 9 次插入4 次删除
  1. 3 0
      CHANGES.txt
  2. 2 2
      src/java/org/apache/hadoop/dfs/DFSClient.java
  3. 4 2
      src/java/org/apache/hadoop/dfs/DataNode.java

+ 3 - 0
CHANGES.txt

@@ -30,6 +30,9 @@ Trunk (unreleased changes)
     rather than standard output, so that it can be distinguished from
     rather than standard output, so that it can be distinguished from
     application output.  (omalley via cutting)
     application output.  (omalley via cutting)
 
 
+ 9. HADOOP-294.  Fixed bug where conditions for retrying after errors
+    in the DFS client were reversed.  (omalley via cutting)
+
 
 
 Release 0.3.1 - 2006-06-05
 Release 0.3.1 - 2006-06-05
 
 

+ 2 - 2
src/java/org/apache/hadoop/dfs/DFSClient.java

@@ -808,7 +808,7 @@ class DFSClient implements FSConstants {
                     localName, overwrite, replication, blockSize);
                     localName, overwrite, replication, blockSize);
               } catch (RemoteException e) {
               } catch (RemoteException e) {
                 if (--retries == 0 || 
                 if (--retries == 0 || 
-                    AlreadyBeingCreatedException.class.getName().
+                    !AlreadyBeingCreatedException.class.getName().
                         equals(e.getClassName())) {
                         equals(e.getClassName())) {
                   throw e;
                   throw e;
                 } else {
                 } else {
@@ -838,7 +838,7 @@ class DFSClient implements FSConstants {
                                          clientName.toString());
                                          clientName.toString());
               } catch (RemoteException e) {
               } catch (RemoteException e) {
                 if (--retries == 0 || 
                 if (--retries == 0 || 
-                    NotReplicatedYetException.class.getName().
+                    !NotReplicatedYetException.class.getName().
                         equals(e.getClassName())) {
                         equals(e.getClassName())) {
                   throw e;
                   throw e;
                 } else {
                 } else {

+ 4 - 2
src/java/org/apache/hadoop/dfs/DataNode.java

@@ -179,7 +179,8 @@ public class DataNode implements FSConstants, Runnable {
         } catch( ConnectException se ) {  // namenode has not been started
         } catch( ConnectException se ) {  // namenode has not been started
           LOG.info("Namenode not available yet, Zzzzz...");
           LOG.info("Namenode not available yet, Zzzzz...");
         } catch( SocketTimeoutException te ) {  // namenode is busy
         } catch( SocketTimeoutException te ) {  // namenode is busy
-          LOG.info("Namenode " + te.getLocalizedMessage() );
+          LOG.info("Problem connecting to Namenode: " + 
+                   StringUtils.stringifyException(te));
         }
         }
         try {
         try {
           Thread.sleep(10 * 1000);
           Thread.sleep(10 * 1000);
@@ -338,7 +339,8 @@ public class DataNode implements FSConstants, Runnable {
       } catch( RemoteException re ) {
       } catch( RemoteException re ) {
         String reClass = re.getClassName();
         String reClass = re.getClassName();
         if( UnregisteredDatanodeException.class.getName().equals( reClass )) {
         if( UnregisteredDatanodeException.class.getName().equals( reClass )) {
-          LOG.warn( "DataNode is shutting down.\n" + re );
+          LOG.warn( "DataNode is shutting down: " + 
+                    StringUtils.stringifyException(re));
           shutdown();
           shutdown();
           return;
           return;
         }
         }