accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject [accumulo] branch 2.0 updated: fix #1277 respond to Hadoop shutdown hook more aggressively (#1279)
Date Mon, 22 Jul 2019 15:06:11 GMT
This is an automated email from the ASF dual-hosted git repository.

kturner pushed a commit to branch 2.0
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/2.0 by this push:
     new 0ed7290  fix #1277 respond to Hadoop shutdown hook more aggressively (#1279)
0ed7290 is described below

commit 0ed729057ac459608756ae3ed4957c1eb042965a
Author: Keith Turner <kturner@apache.org>
AuthorDate: Mon Jul 22 11:06:06 2019 -0400

    fix #1277 respond to Hadoop shutdown hook more aggressively (#1279)
---
 core/src/main/java/org/apache/accumulo/fate/Fate.java | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/core/src/main/java/org/apache/accumulo/fate/Fate.java b/core/src/main/java/org/apache/accumulo/fate/Fate.java
index a5a0869..55025e0 100644
--- a/core/src/main/java/org/apache/accumulo/fate/Fate.java
+++ b/core/src/main/java/org/apache/accumulo/fate/Fate.java
@@ -134,13 +134,22 @@ public class Fate<T> {
      * transaction can resume.
      */
     private void blockIfHadoopShutdown(long tid, Exception e) {
-      if (isIOException(e) && ShutdownUtil.isShutdownInProgress()) {
+      if (ShutdownUtil.isShutdownInProgress()) {
         String tidStr = FateTxId.formatTid(tid);
-        log.info("Ignoring exception that was likely caused by Hadoop Shutdown hook. {} ",
tidStr,
-            e);
+
+        if (e instanceof AcceptableException) {
+          log.debug("Ignoring exception possibly caused by Hadoop Shutdown hook. {} ", tidStr,
e);
+        } else if (isIOException(e)) {
+          log.info("Ignoring exception likely caused by Hadoop Shutdown hook. {} ", tidStr,
e);
+        } else {
+          // sometimes code will catch an IOException caused by the hadoop shutdown hook
and throw
+          // another exception without setting the cause.
+          log.warn("Ignoring exception possibly caused by Hadoop Shutdown hook. {} ", tidStr,
e);
+        }
 
         while (true) {
-          // Nothing is going to work well at this point, so why even try. Just wait for
the end.
+          // Nothing is going to work well at this point, so why even try. Just wait for
the end,
+          // preventing this FATE thread from processing further work and likely failing.
           UtilWaitThread.sleepUninterruptibly(1, TimeUnit.MINUTES);
         }
       }


Mime
View raw message