You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by jl...@apache.org on 2016/02/02 20:31:55 UTC

hadoop git commit: MAPREDUCE-6621. Memory Leak in JobClient#submitJobInternal(). Contributed by Xuan Gong (cherry picked from commit 43e669b22d9ac0b81ab8cc397c5d6d92bac986c6)

Repository: hadoop
Updated Branches:
  refs/heads/branch-2 60d3a3c30 -> 4ee097768


MAPREDUCE-6621. Memory Leak in JobClient#submitJobInternal(). Contributed by Xuan Gong
(cherry picked from commit 43e669b22d9ac0b81ab8cc397c5d6d92bac986c6)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/4ee09776
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/4ee09776
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/4ee09776

Branch: refs/heads/branch-2
Commit: 4ee097768779279cdc45fe54c6182714b5190390
Parents: 60d3a3c
Author: Jason Lowe <jl...@apache.org>
Authored: Tue Feb 2 19:30:45 2016 +0000
Committer: Jason Lowe <jl...@apache.org>
Committed: Tue Feb 2 19:31:33 2016 +0000

----------------------------------------------------------------------
 hadoop-mapreduce-project/CHANGES.txt                         | 6 ++++++
 .../src/main/java/org/apache/hadoop/mapred/JobClient.java    | 8 ++++++++
 2 files changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/4ee09776/hadoop-mapreduce-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt
index ffec206..bd04524 100644
--- a/hadoop-mapreduce-project/CHANGES.txt
+++ b/hadoop-mapreduce-project/CHANGES.txt
@@ -450,6 +450,9 @@ Release 2.7.3 - UNRELEASED
     MAPREDUCE-6618. YarnClientProtocolProvider leaking the YarnClient thread.
     (Xuan Gong via jlowe)
 
+    MAPREDUCE-6621. Memory Leak in JobClient#submitJobInternal() (Xuan Gong
+    via jlowe)
+
 Release 2.7.2 - 2016-01-25
 
   INCOMPATIBLE CHANGES
@@ -755,6 +758,9 @@ Release 2.6.4 - UNRELEASED
     MAPREDUCE-6618. YarnClientProtocolProvider leaking the YarnClient thread.
     (Xuan Gong via jlowe)
 
+    MAPREDUCE-6621. Memory Leak in JobClient#submitJobInternal() (Xuan Gong
+    via jlowe)
+
 Release 2.6.3 - 2015-12-17
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/4ee09776/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java
index 0b0ab2b..77d641c 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java
@@ -577,10 +577,18 @@ public class JobClient extends CLI implements AutoCloseable {
           return job;
         }
       });
+
+      Cluster prev = cluster;
       // update our Cluster instance with the one created by Job for submission
       // (we can't pass our Cluster instance to Job, since Job wraps the config
       // instance, and the two configs would then diverge)
       cluster = job.getCluster();
+
+      // It is important to close the previous cluster instance
+      // to cleanup resources.
+      if (prev != null) {
+        prev.close();
+      }
       return new NetworkedJob(job);
     } catch (InterruptedException ie) {
       throw new IOException("interrupted", ie);