hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject svn commit: r1562622 - in /hadoop/common/branches/branch-2.3/hadoop-common-project: ./ hadoop-auth/ hadoop-common/ hadoop-common/src/ hadoop-common/src/main/docs/ hadoop-common/src/main/java/ hadoop-common/src/main/java/org/apache/hadoop/fs/s3native/ h...
Date Wed, 29 Jan 2014 22:49:28 GMT
Author: wang
Date: Wed Jan 29 22:49:27 2014
New Revision: 1562622

URL: http://svn.apache.org/r1562622
Log:
HADOOP-10203. Connection leak in Jets3tNativeFileSystemStore#retrieveMetadata. Contributed
by Andrei Savu.

Modified:
    hadoop/common/branches/branch-2.3/hadoop-common-project/   (props changed)
    hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-auth/   (props changed)
    hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-common/   (props changed)
    hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-common/CHANGES.txt   (contents,
props changed)
    hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-common/src/   (props changed)
    hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-common/src/main/docs/ 
 (props changed)
    hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-common/src/main/java/ 
 (props changed)
    hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/s3native/Jets3tNativeFileSystemStore.java
    hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-common/src/test/core/ 
 (props changed)

Propchange: hadoop/common/branches/branch-2.3/hadoop-common-project/
------------------------------------------------------------------------------
  Merged /hadoop/common/branches/branch-2/hadoop-common-project:r1561724

Propchange: hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-auth/
------------------------------------------------------------------------------
  Merged /hadoop/common/branches/branch-2/hadoop-common-project/hadoop-auth:r1561724

Propchange: hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-common/
------------------------------------------------------------------------------
  Merged /hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common:r1561724

Modified: hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-common/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1562622&r1=1562621&r2=1562622&view=diff
==============================================================================
--- hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-common/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-common/CHANGES.txt Wed
Jan 29 22:49:27 2014
@@ -372,6 +372,9 @@ Release 2.3.0 - UNRELEASED
     HADOOP-10250. VersionUtil returns wrong value when comparing two versions.
     (Yongjun Zhang via atm)
 
+    HADOOP-10203. Connection leak in
+    Jets3tNativeFileSystemStore#retrieveMetadata. (Andrei Savu via atm)
+
 Release 2.2.0 - 2013-10-13
 
   INCOMPATIBLE CHANGES

Propchange: hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-common/CHANGES.txt
------------------------------------------------------------------------------
  Merged /hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt:r1561724

Propchange: hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-common/src/
------------------------------------------------------------------------------
  Merged /hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src:r1561724

Propchange: hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-common/src/main/docs/
------------------------------------------------------------------------------
  Merged /hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/docs:r1561724

Propchange: hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-common/src/main/java/
------------------------------------------------------------------------------
  Merged /hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java:r1561724

Modified: hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/s3native/Jets3tNativeFileSystemStore.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/s3native/Jets3tNativeFileSystemStore.java?rev=1562622&r1=1562621&r2=1562622&view=diff
==============================================================================
--- hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/s3native/Jets3tNativeFileSystemStore.java
(original)
+++ hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/s3native/Jets3tNativeFileSystemStore.java
Wed Jan 29 22:49:27 2014
@@ -110,23 +110,29 @@ class Jets3tNativeFileSystemStore implem
       handleS3ServiceException(e);
     }
   }
-  
+
   @Override
   public FileMetadata retrieveMetadata(String key) throws IOException {
+    StorageObject object = null;
     try {
       if(LOG.isDebugEnabled()) {
         LOG.debug("Getting metadata for key: " + key + " from bucket:" + bucket.getName());
       }
-      S3Object object = s3Service.getObject(bucket.getName(), key);
+      object = s3Service.getObjectDetails(bucket.getName(), key);
       return new FileMetadata(key, object.getContentLength(),
           object.getLastModifiedDate().getTime());
-    } catch (S3ServiceException e) {
+
+    } catch (ServiceException e) {
       // Following is brittle. Is there a better way?
-      if (e.getS3ErrorCode().matches("NoSuchKey")) {
+      if ("NoSuchKey".equals(e.getErrorCode())) {
         return null; //return null if key not found
       }
-      handleS3ServiceException(e);
+      handleServiceException(e);
       return null; //never returned - keep compiler happy
+    } finally {
+      if (object != null) {
+        object.closeDataInputStream();
+      }
     }
   }
 

Propchange: hadoop/common/branches/branch-2.3/hadoop-common-project/hadoop-common/src/test/core/
------------------------------------------------------------------------------
  Merged /hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/core:r1561724



Mime
View raw message