[07/50] [abbrv] hadoop git commit: YARN-9067. YARN Resource Manager is running OOM because of leak of Configuration Object. Contributed by Eric Yang.

2018-12-05 Thread shv
YARN-9067. YARN Resource Manager is running OOM because of leak of 
Configuration Object. Contributed by Eric Yang.


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

Branch: refs/heads/HDFS-12943
Commit: efc4d91cbeab8a13f6d61cb0e56443adb2d77559
Parents: fe7dab8
Author: Weiwei Yang 
Authored: Thu Nov 29 09:34:14 2018 +0800
Committer: Weiwei Yang 
Committed: Thu Nov 29 09:34:14 2018 +0800

--
 .../hadoop/yarn/service/webapp/ApiServer.java   | 209 +++
 .../hadoop/yarn/service/ServiceClientTest.java  |   2 +-
 .../yarn/service/client/ServiceClient.java  |   1 +
 3 files changed, 126 insertions(+), 86 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/efc4d91c/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java
--
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java
index db831ba..88aeefd 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java
@@ -118,10 +118,13 @@ public class ApiServer {
   @Override
   public Void run() throws YarnException, IOException {
 ServiceClient sc = getServiceClient();
-sc.init(YARN_CONFIG);
-sc.start();
-sc.actionBuild(service);
-sc.close();
+try {
+  sc.init(YARN_CONFIG);
+  sc.start();
+  sc.actionBuild(service);
+} finally {
+  sc.close();
+}
 return null;
   }
 });
@@ -133,11 +136,14 @@ public class ApiServer {
   @Override
   public ApplicationId run() throws IOException, YarnException {
 ServiceClient sc = getServiceClient();
-sc.init(YARN_CONFIG);
-sc.start();
-ApplicationId applicationId = sc.actionCreate(service);
-sc.close();
-return applicationId;
+try {
+  sc.init(YARN_CONFIG);
+  sc.start();
+  ApplicationId applicationId = sc.actionCreate(service);
+  return applicationId;
+} finally {
+  sc.close();
+}
   }
 });
 serviceStatus.setDiagnostics("Application ID: " + applicationId);
@@ -245,29 +251,32 @@ public class ApiServer {
   public Integer run() throws Exception {
 int result = 0;
 ServiceClient sc = getServiceClient();
-sc.init(YARN_CONFIG);
-sc.start();
-Exception stopException = null;
 try {
-  result = sc.actionStop(appName, destroy);
-  if (result == EXIT_SUCCESS) {
-LOG.info("Successfully stopped service {}", appName);
-  }
-} catch (Exception e) {
-  LOG.info("Got exception stopping service", e);
-  stopException = e;
-}
-if (destroy) {
-  result = sc.actionDestroy(appName);
-  if (result == EXIT_SUCCESS) {
-LOG.info("Successfully deleted service {}", appName);
+  sc.init(YARN_CONFIG);
+  sc.start();
+  Exception stopException = null;
+  try {
+result = sc.actionStop(appName, destroy);
+if (result == EXIT_SUCCESS) {
+  LOG.info("Successfully stopped service {}", appName);
+}
+  } catch (Exception e) {
+LOG.info("Got exception stopping service", e);
+stopException = e;
   }
-} else {
-  if (stopException != null) {
-throw stopException;
+  if (destroy) {
+result = sc.actionDestroy(appName);
+if (result == EXIT_SUCCESS) {
+  LOG.info("Successfully deleted service {}", appName);
+}
+  } else {
+if (stopException != null) {
+  throw stopException;
+

[05/50] [abbrv] hadoop git commit: YARN-9067. YARN Resource Manager is running OOM because of leak of Configuration Object. Contributed by Eric Yang.

2018-11-29 Thread xyao
YARN-9067. YARN Resource Manager is running OOM because of leak of 
Configuration Object. Contributed by Eric Yang.


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

Branch: refs/heads/HDDS-4
Commit: efc4d91cbeab8a13f6d61cb0e56443adb2d77559
Parents: fe7dab8
Author: Weiwei Yang 
Authored: Thu Nov 29 09:34:14 2018 +0800
Committer: Weiwei Yang 
Committed: Thu Nov 29 09:34:14 2018 +0800

--
 .../hadoop/yarn/service/webapp/ApiServer.java   | 209 +++
 .../hadoop/yarn/service/ServiceClientTest.java  |   2 +-
 .../yarn/service/client/ServiceClient.java  |   1 +
 3 files changed, 126 insertions(+), 86 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/efc4d91c/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java
--
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java
index db831ba..88aeefd 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java
@@ -118,10 +118,13 @@ public class ApiServer {
   @Override
   public Void run() throws YarnException, IOException {
 ServiceClient sc = getServiceClient();
-sc.init(YARN_CONFIG);
-sc.start();
-sc.actionBuild(service);
-sc.close();
+try {
+  sc.init(YARN_CONFIG);
+  sc.start();
+  sc.actionBuild(service);
+} finally {
+  sc.close();
+}
 return null;
   }
 });
@@ -133,11 +136,14 @@ public class ApiServer {
   @Override
   public ApplicationId run() throws IOException, YarnException {
 ServiceClient sc = getServiceClient();
-sc.init(YARN_CONFIG);
-sc.start();
-ApplicationId applicationId = sc.actionCreate(service);
-sc.close();
-return applicationId;
+try {
+  sc.init(YARN_CONFIG);
+  sc.start();
+  ApplicationId applicationId = sc.actionCreate(service);
+  return applicationId;
+} finally {
+  sc.close();
+}
   }
 });
 serviceStatus.setDiagnostics("Application ID: " + applicationId);
@@ -245,29 +251,32 @@ public class ApiServer {
   public Integer run() throws Exception {
 int result = 0;
 ServiceClient sc = getServiceClient();
-sc.init(YARN_CONFIG);
-sc.start();
-Exception stopException = null;
 try {
-  result = sc.actionStop(appName, destroy);
-  if (result == EXIT_SUCCESS) {
-LOG.info("Successfully stopped service {}", appName);
-  }
-} catch (Exception e) {
-  LOG.info("Got exception stopping service", e);
-  stopException = e;
-}
-if (destroy) {
-  result = sc.actionDestroy(appName);
-  if (result == EXIT_SUCCESS) {
-LOG.info("Successfully deleted service {}", appName);
+  sc.init(YARN_CONFIG);
+  sc.start();
+  Exception stopException = null;
+  try {
+result = sc.actionStop(appName, destroy);
+if (result == EXIT_SUCCESS) {
+  LOG.info("Successfully stopped service {}", appName);
+}
+  } catch (Exception e) {
+LOG.info("Got exception stopping service", e);
+stopException = e;
   }
-} else {
-  if (stopException != null) {
-throw stopException;
+  if (destroy) {
+result = sc.actionDestroy(appName);
+if (result == EXIT_SUCCESS) {
+  LOG.info("Successfully deleted service {}", appName);
+}
+  } else {
+if (stopException != null) {
+  throw stopException;
+

hadoop git commit: YARN-9067. YARN Resource Manager is running OOM because of leak of Configuration Object. Contributed by Eric Yang.

2018-11-28 Thread wwei
Repository: hadoop
Updated Branches:
  refs/heads/trunk fe7dab8ef -> efc4d91cb


YARN-9067. YARN Resource Manager is running OOM because of leak of 
Configuration Object. Contributed by Eric Yang.


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

Branch: refs/heads/trunk
Commit: efc4d91cbeab8a13f6d61cb0e56443adb2d77559
Parents: fe7dab8
Author: Weiwei Yang 
Authored: Thu Nov 29 09:34:14 2018 +0800
Committer: Weiwei Yang 
Committed: Thu Nov 29 09:34:14 2018 +0800

--
 .../hadoop/yarn/service/webapp/ApiServer.java   | 209 +++
 .../hadoop/yarn/service/ServiceClientTest.java  |   2 +-
 .../yarn/service/client/ServiceClient.java  |   1 +
 3 files changed, 126 insertions(+), 86 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/efc4d91c/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java
--
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java
index db831ba..88aeefd 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java
@@ -118,10 +118,13 @@ public class ApiServer {
   @Override
   public Void run() throws YarnException, IOException {
 ServiceClient sc = getServiceClient();
-sc.init(YARN_CONFIG);
-sc.start();
-sc.actionBuild(service);
-sc.close();
+try {
+  sc.init(YARN_CONFIG);
+  sc.start();
+  sc.actionBuild(service);
+} finally {
+  sc.close();
+}
 return null;
   }
 });
@@ -133,11 +136,14 @@ public class ApiServer {
   @Override
   public ApplicationId run() throws IOException, YarnException {
 ServiceClient sc = getServiceClient();
-sc.init(YARN_CONFIG);
-sc.start();
-ApplicationId applicationId = sc.actionCreate(service);
-sc.close();
-return applicationId;
+try {
+  sc.init(YARN_CONFIG);
+  sc.start();
+  ApplicationId applicationId = sc.actionCreate(service);
+  return applicationId;
+} finally {
+  sc.close();
+}
   }
 });
 serviceStatus.setDiagnostics("Application ID: " + applicationId);
@@ -245,29 +251,32 @@ public class ApiServer {
   public Integer run() throws Exception {
 int result = 0;
 ServiceClient sc = getServiceClient();
-sc.init(YARN_CONFIG);
-sc.start();
-Exception stopException = null;
 try {
-  result = sc.actionStop(appName, destroy);
-  if (result == EXIT_SUCCESS) {
-LOG.info("Successfully stopped service {}", appName);
-  }
-} catch (Exception e) {
-  LOG.info("Got exception stopping service", e);
-  stopException = e;
-}
-if (destroy) {
-  result = sc.actionDestroy(appName);
-  if (result == EXIT_SUCCESS) {
-LOG.info("Successfully deleted service {}", appName);
+  sc.init(YARN_CONFIG);
+  sc.start();
+  Exception stopException = null;
+  try {
+result = sc.actionStop(appName, destroy);
+if (result == EXIT_SUCCESS) {
+  LOG.info("Successfully stopped service {}", appName);
+}
+  } catch (Exception e) {
+LOG.info("Got exception stopping service", e);
+stopException = e;
   }
-} else {
-  if (stopException != null) {
-throw stopException;
+  if (destroy) {
+result = sc.actionDestroy(appName);
+if (result == EXIT_SUCCESS) {
+  LOG.info("Successfully deleted service {}", appName);
+}
+  } else {
+