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 ab...@apache.org on 2019/09/09 08:56:13 UTC

[hadoop] branch trunk updated: YARN-9821. NM hangs at serviceStop when ATSV2 Backend Hbase is Down. Contributed by Prabhu Joseph.

This is an automated email from the ASF dual-hosted git repository.

abmodi pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 60af879  YARN-9821. NM hangs at serviceStop when ATSV2 Backend Hbase is Down. Contributed by Prabhu Joseph.
60af879 is described below

commit 60af8793b45b4057101a22e4248d7ca022b52d79
Author: Abhishek Modi <ab...@apache.org>
AuthorDate: Mon Sep 9 14:26:00 2019 +0530

    YARN-9821. NM hangs at serviceStop when ATSV2 Backend Hbase is Down. Contributed by Prabhu Joseph.
---
 .../storage/HBaseTimelineWriterImpl.java           | 74 ++++++++++++----------
 1 file changed, 42 insertions(+), 32 deletions(-)

diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-client/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/HBaseTimelineWriterImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-client/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/HBaseTimelineWriterImpl.java
index a398feb..dda004d 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-client/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/HBaseTimelineWriterImpl.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-client/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/HBaseTimelineWriterImpl.java
@@ -630,39 +630,49 @@ public class HBaseTimelineWriterImpl extends AbstractService implements
    */
   @Override
   protected void serviceStop() throws Exception {
-    if (entityTable != null) {
-      LOG.info("closing the entity table");
-      // The close API performs flushing and releases any resources held
-      entityTable.close();
+    boolean isStorageUp = true;
+    try {
+      storageMonitor.checkStorageIsUp();
+    } catch (IOException e) {
+      LOG.warn("Failed to close the timeline tables as Hbase is down", e);
+      isStorageUp = false;
     }
-    if (appToFlowTable != null) {
-      LOG.info("closing the app_flow table");
-      // The close API performs flushing and releases any resources held
-      appToFlowTable.close();
-    }
-    if (applicationTable != null) {
-      LOG.info("closing the application table");
-      applicationTable.close();
-    }
-    if (flowRunTable != null) {
-      LOG.info("closing the flow run table");
-      // The close API performs flushing and releases any resources held
-      flowRunTable.close();
-    }
-    if (flowActivityTable != null) {
-      LOG.info("closing the flowActivityTable table");
-      // The close API performs flushing and releases any resources held
-      flowActivityTable.close();
-    }
-    if (subApplicationTable != null) {
-      subApplicationTable.close();
-    }
-    if (domainTable != null) {
-      domainTable.close();
-    }
-    if (conn != null) {
-      LOG.info("closing the hbase Connection");
-      conn.close();
+
+    if (isStorageUp) {
+      if (entityTable != null) {
+        LOG.info("closing the entity table");
+        // The close API performs flushing and releases any resources held
+        entityTable.close();
+      }
+      if (appToFlowTable != null) {
+        LOG.info("closing the app_flow table");
+        // The close API performs flushing and releases any resources held
+        appToFlowTable.close();
+      }
+      if (applicationTable != null) {
+        LOG.info("closing the application table");
+        applicationTable.close();
+      }
+      if (flowRunTable != null) {
+        LOG.info("closing the flow run table");
+        // The close API performs flushing and releases any resources held
+        flowRunTable.close();
+      }
+      if (flowActivityTable != null) {
+        LOG.info("closing the flowActivityTable table");
+        // The close API performs flushing and releases any resources held
+        flowActivityTable.close();
+      }
+      if (subApplicationTable != null) {
+        subApplicationTable.close();
+      }
+      if (domainTable != null) {
+        domainTable.close();
+      }
+      if (conn != null) {
+        LOG.info("closing the hbase Connection");
+        conn.close();
+      }
     }
     storageMonitor.stop();
     super.serviceStop();


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org