hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhr...@apache.org
Subject svn commit: r632229 - /hadoop/core/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java
Date Fri, 29 Feb 2008 06:11:27 GMT
Author: dhruba
Date: Thu Feb 28 22:11:15 2008
New Revision: 632229

URL: http://svn.apache.org/viewvc?rev=632229&view=rev
Log:
This fixes a bug that was introeuced by an earlier checkin to 
HADOOP-2891 (DFSClient.close() closes all open files.). The 
DFSClient.close release the lock on the outputstream before
acquiring the lock on pendingCreates.


Modified:
    hadoop/core/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java

Modified: hadoop/core/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java?rev=632229&r1=632228&r2=632229&view=diff
==============================================================================
--- hadoop/core/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java (original)
+++ hadoop/core/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java Thu Feb 28 22:11:15 2008
@@ -2218,10 +2218,14 @@
       }
     }
   
-    private void internalClose() throws IOException {
-      // Clean up any resources that might be held.
-      closed = true;
-      
+    /**
+     * Closes this output stream and releases any system 
+     * resources associated with this stream.
+     */
+    @Override
+    public void close() throws IOException {
+      closeInternal();
+
       synchronized (pendingCreates) {
         pendingCreates.remove(src);
       }
@@ -2236,8 +2240,7 @@
      * Closes this output stream and releases any system 
      * resources associated with this stream.
      */
-    @Override
-    public synchronized void close() throws IOException {
+    private synchronized void closeInternal() throws IOException {
       checkOpen();
       isClosed();
 
@@ -2306,7 +2309,7 @@
       } catch (InterruptedException e) {
         throw new IOException("Failed to shutdown response thread");
       } finally {
-        internalClose();
+        closed = true;
       }
     }
 



Mime
View raw message