hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rang...@apache.org
Subject svn commit: r674930 - in /hadoop/core/branches/branch-0.17: CHANGES.txt src/java/org/apache/hadoop/dfs/DFSClient.java
Date Tue, 08 Jul 2008 20:00:05 GMT
Author: rangadi
Date: Tue Jul  8 13:00:04 2008
New Revision: 674930

URL: http://svn.apache.org/viewvc?rev=674930&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.17/CHANGES.txt
    hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/dfs/DFSClient.java

Modified: hadoop/core/branches/branch-0.17/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.17/CHANGES.txt?rev=674930&r1=674929&r2=674930&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.17/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.17/CHANGES.txt Tue Jul  8 13:00:04 2008
@@ -1,5 +1,11 @@
 Hadoop Change Log
 
+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
 

Modified: hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/dfs/DFSClient.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/dfs/DFSClient.java?rev=674930&r1=674929&r2=674930&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/dfs/DFSClient.java (original)
+++ hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/dfs/DFSClient.java Tue Jul
 8 13:00:04 2008
@@ -1887,8 +1887,9 @@
                         " size:" + len + 
                         " offsetInBlock:" + offsetInBlock +
                         " lastPacketInBlock:" + one.lastPacketInBlock);
-            } catch (IOException e) {
-              LOG.warn("DataStreamer Exception: " + e);
+            } catch (Throwable e) {
+              LOG.warn("DataStreamer Exception: " + 
+                        StringUtils.stringifyException(e));
               hasError = true;
             }
           }
@@ -2629,6 +2630,7 @@
           }
 
         flushInternal();             // flush all data to Datanodes
+        isClosed();
         closed = true;
 
         closeThreads();
@@ -2651,6 +2653,8 @@
 
         long localstart = System.currentTimeMillis();
         boolean fileComplete = false;
+        int fileCompleteRetry = 0;
+        final int checkFileCompleteRetry = 10;
         while (!fileComplete) {
           fileComplete = namenode.complete(src, clientName);
           if (!fileComplete) {
@@ -2661,6 +2665,9 @@
               }
             } catch (InterruptedException ie) {
             }
+            // after retrying for checkFileCompleteRetry times check isClosed() 
+            if ((++fileCompleteRetry % checkFileCompleteRetry) == 0) 
+              isClosed();
           }
         }
       } finally {



Mime
View raw message