hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rang...@apache.org
Subject svn commit: r674931 - in /hadoop/core/branches/branch-0.18: CHANGES.txt src/hdfs/org/apache/hadoop/dfs/DFSClient.java src/test/org/apache/hadoop/dfs/TestFileCreationDelete.java
Date Tue, 08 Jul 2008 20:02:17 GMT
Author: rangadi
Date: Tue Jul  8 13:02:16 2008
New Revision: 674931

URL: http://svn.apache.org/viewvc?rev=674931&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/branches/branch-0.18/CHANGES.txt
    hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/DFSClient.java
    hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/dfs/TestFileCreationDelete.java

Modified: hadoop/core/branches/branch-0.18/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/CHANGES.txt?rev=674931&r1=674930&r2=674931&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.18/CHANGES.txt Tue Jul  8 13:02:16 2008
@@ -734,7 +734,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/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/DFSClient.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/DFSClient.java?rev=674931&r1=674930&r2=674931&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/DFSClient.java (original)
+++ hadoop/core/branches/branch-0.18/src/hdfs/org/apache/hadoop/dfs/DFSClient.java Tue Jul
 8 13:02:16 2008
@@ -1948,8 +1948,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;
             }
           }
@@ -2698,6 +2699,7 @@
           }
 
         flushInternal();             // flush all data to Datanodes
+        isClosed();
         closed = true;
 
         closeThreads();
@@ -2720,6 +2722,8 @@
 
         long localstart = System.currentTimeMillis();
         boolean fileComplete = false;
+        int fileCompleteRetry = 0;
+        final int checkFileCompleteRetry = 10;
         while (!fileComplete) {
           fileComplete = namenode.complete(src, clientName);
           if (!fileComplete) {
@@ -2730,6 +2734,9 @@
               }
             } catch (InterruptedException ie) {
             }
+            // after retrying for checkFileCompleteRetry times check isClosed() 
+            if ((++fileCompleteRetry % checkFileCompleteRetry) == 0) 
+              isClosed();
           }
         }
       } finally {

Modified: hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/dfs/TestFileCreationDelete.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/dfs/TestFileCreationDelete.java?rev=674931&r1=674930&r2=674931&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/dfs/TestFileCreationDelete.java
(original)
+++ hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/dfs/TestFileCreationDelete.java
Tue Jul  8 13:02:16 2008
@@ -88,7 +88,8 @@
       assertTrue(!fs.exists(file1));
       assertTrue(fs.exists(file2));
     } finally {
+      fs.close();
       cluster.shutdown();
     }
   }
-}
\ No newline at end of file
+}



Mime
View raw message