Repository: sentry
Updated Branches:
  refs/heads/sentry-ha-redesign 8da7208e7 -> 72841bff7


SENTRY-1628: In HMSFollower failing of catching error causes the executor to 
halt (Hao Hao, Reviewed by: Vamsee Yarlagadda)

Change-Id: Ieaff2d45f6d90df9a180019ba01f69cd1260e430


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

Branch: refs/heads/sentry-ha-redesign
Commit: 72841bff7f3feb761332040540662afef053a8ff
Parents: 8da7208
Author: hahao <[email protected]>
Authored: Fri Feb 17 11:10:06 2017 -0800
Committer: hahao <[email protected]>
Committed: Fri Feb 17 11:10:06 2017 -0800

----------------------------------------------------------------------
 .../java/org/apache/sentry/service/thrift/HMSFollower.java    | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/72841bff/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java
----------------------------------------------------------------------
diff --git 
a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java
 
b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java
index 783c0fc..8913b09 100644
--- 
a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java
+++ 
b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java
@@ -272,13 +272,16 @@ public class HMSFollower implements Runnable {
           }
         } catch (LoginException le) {
           LOGGER.warn("Failed to stop kerberos context (potential to cause 
thread leak)", le);
-          throw new RuntimeException(le);
         }
       } else {
         LOGGER.error("ThriftException occured fetching Notification entries, 
will try", e);
       }
     } catch (SentryInvalidInputException|SentryInvalidHMSEventException e) {
-      throw new RuntimeException(e);
+      LOGGER.error("Encounter 
SentryInvalidInputException|SentryInvalidHMSEventException " +
+                   "while processing notification log", e);
+    } catch (Throwable t) {
+      // catching errors to prevent the executor to halt.
+      LOGGER.error("Caught unexpected exception in HMSFollower!", 
t.getCause());
     }
   }
 

Reply via email to