hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rang...@apache.org
Subject svn commit: r674932 - in /hadoop/core/trunk: CHANGES.txt src/hdfs/org/apache/hadoop/hdfs/DFSClient.java src/test/org/apache/hadoop/hdfs/TestFileCreationDelete.java
Date Tue, 08 Jul 2008 20:03:46 GMT
Author: rangadi
Date: Tue Jul  8 13:03:46 2008
New Revision: 674932

URL: http://svn.apache.org/viewvc?rev=674932&view=rev
Log:
HADOOP-3681. DFSClient can get into an infinite loop while closing
a file if there are some errors. (Lohit Vijayarenu via rangadi)

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java
    hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/TestFileCreationDelete.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=674932&r1=674931&r2=674932&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Tue Jul  8 13:03:46 2008
@@ -785,7 +785,14 @@
 
     HADOOP-3691. Fix streaming and tutorial docs. (Jothi Padmanabhan via ddas)
 
-Release 0.17.1 - Unreleased
+Release 0.17.2 - Unreleased
+
+  BUG FIXES
+
+    HADOOP-3681. DFSClient can get into an infinite loop while closing
+    a file if there are some errors. (Lohit Vijayarenu via rangadi)
+
+Release 0.17.1 - 2008-06-23
 
   INCOMPATIBLE CHANGES
 

Modified: hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java?rev=674932&r1=674931&r2=674932&view=diff
==============================================================================
--- hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java (original)
+++ hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java Tue Jul  8 13:03:46 2008
@@ -1953,8 +1953,9 @@
                           " offsetInBlock:" + one.offsetInBlock + 
                           " lastPacketInBlock:" + one.lastPacketInBlock);
               }
-            } catch (IOException e) {
-              LOG.warn("DataStreamer Exception: " + e);
+            } catch (Throwable e) {
+              LOG.warn("DataStreamer Exception: " + 
+                       StringUtils.stringifyException(e));
               hasError = true;
             }
           }
@@ -2703,6 +2704,7 @@
           }
 
         flushInternal();             // flush all data to Datanodes
+        isClosed();
         closed = true;
 
         closeThreads();
@@ -2725,6 +2727,8 @@
 
         long localstart = System.currentTimeMillis();
         boolean fileComplete = false;
+        int fileCompleteRetry = 0;
+        final int checkFileCompleteRetry = 10;
         while (!fileComplete) {
           fileComplete = namenode.complete(src, clientName);
           if (!fileComplete) {
@@ -2735,6 +2739,9 @@
               }
             } catch (InterruptedException ie) {
             }
+            // after retrying for checkFileCompleteRetry times check isClosed() 
+            if ((++fileCompleteRetry % checkFileCompleteRetry) == 0) 
+              isClosed();
           }
         }
       } finally {

Modified: hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/TestFileCreationDelete.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/TestFileCreationDelete.java?rev=674932&r1=674931&r2=674932&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/TestFileCreationDelete.java (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/hdfs/TestFileCreationDelete.java Tue Jul
 8 13:03:46 2008
@@ -91,6 +91,7 @@
       assertTrue(!fs.exists(file1));
       assertTrue(fs.exists(file2));
     } finally {
+      fs.close();
       cluster.shutdown();
     }
   }



Mime
View raw message