tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss...@apache.org
Subject git commit: TEZ-1162. Fix CodecPool leaks in Shuffle (gopalv)
Date Thu, 26 Jun 2014 19:21:57 GMT
Repository: incubator-tez
Updated Branches:
  refs/heads/branch-0.4.1-incubating f531ed550 -> 03633b839


TEZ-1162. Fix CodecPool leaks in Shuffle (gopalv)


Project: http://git-wip-us.apache.org/repos/asf/incubator-tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tez/commit/03633b83
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tez/tree/03633b83
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tez/diff/03633b83

Branch: refs/heads/branch-0.4.1-incubating
Commit: 03633b839e6af006b893dca05951b345065eff14
Parents: f531ed5
Author: Gopal V <gopalv@apache.org>
Authored: Tue Jun 3 21:30:52 2014 -0700
Committer: Siddharth Seth <sseth@apache.org>
Committed: Thu Jun 26 12:21:10 2014 -0700

----------------------------------------------------------------------
 .../tez/runtime/library/shuffle/common/ShuffleUtils.java    | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/03633b83/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/shuffle/common/ShuffleUtils.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/shuffle/common/ShuffleUtils.java
b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/shuffle/common/ShuffleUtils.java
index 0c7cb2e..2aadf09 100644
--- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/shuffle/common/ShuffleUtils.java
+++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/shuffle/common/ShuffleUtils.java
@@ -82,9 +82,11 @@ public class ShuffleUtils {
 
     input = checksumIn;
 
+    Decompressor decompressor = null;
+    
     // Are map-outputs compressed?
     if (codec != null) {
-      Decompressor decompressor = CodecPool.getDecompressor(codec);
+      decompressor = CodecPool.getDecompressor(codec);
       decompressor.reset();
       input = codec.createInputStream(input, decompressor);
     }
@@ -101,6 +103,11 @@ public class ShuffleUtils {
       IOUtils.cleanup(LOG, input);
       // Re-throw
       throw ioe;
+    } finally {
+      if(decompressor != null) {
+        decompressor.reset();
+        CodecPool.returnDecompressor(decompressor);
+      }
     }
   }
   


Mime
View raw message