Browse Source

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 years ago
parent
commit
3ab5cc64ad

+ 3 - 0
CHANGES.txt

@@ -30,6 +30,9 @@ Trunk (unreleased changes)
     rather than standard output, so that it can be distinguished from
     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
 

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

@@ -808,7 +808,7 @@ class DFSClient implements FSConstants {
                     localName, overwrite, replication, blockSize);
               } catch (RemoteException e) {
                 if (--retries == 0 || 
-                    AlreadyBeingCreatedException.class.getName().
+                    !AlreadyBeingCreatedException.class.getName().
                         equals(e.getClassName())) {
                   throw e;
                 } else {
@@ -838,7 +838,7 @@ class DFSClient implements FSConstants {
                                          clientName.toString());
               } catch (RemoteException e) {
                 if (--retries == 0 || 
-                    NotReplicatedYetException.class.getName().
+                    !NotReplicatedYetException.class.getName().
                         equals(e.getClassName())) {
                   throw e;
                 } 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
           LOG.info("Namenode not available yet, Zzzzz...");
         } catch( SocketTimeoutException te ) {  // namenode is busy
-          LOG.info("Namenode " + te.getLocalizedMessage() );
+          LOG.info("Problem connecting to Namenode: " + 
+                   StringUtils.stringifyException(te));
         }
         try {
           Thread.sleep(10 * 1000);
@@ -338,7 +339,8 @@ public class DataNode implements FSConstants, Runnable {
       } catch( RemoteException re ) {
         String reClass = re.getClassName();
         if( UnregisteredDatanodeException.class.getName().equals( reClass )) {
-          LOG.warn( "DataNode is shutting down.\n" + re );
+          LOG.warn( "DataNode is shutting down: " + 
+                    StringUtils.stringifyException(re));
           shutdown();
           return;
         }