You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sentry.apache.org by va...@apache.org on 2017/08/18 15:09:48 UTC

sentry git commit: SENTRY-1889: HMSFollower should log better detailed error message if it cannot connect to HMS (Sergio Pena via Vamsee Yarlagadda)

Repository: sentry
Updated Branches:
  refs/heads/master 7bac9f4f9 -> 2fa149d19


SENTRY-1889: HMSFollower should log better detailed error message if it cannot connect to HMS (Sergio Pena via Vamsee Yarlagadda)


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

Branch: refs/heads/master
Commit: 2fa149d19eff8f56414e916955b76a3c73135686
Parents: 7bac9f4
Author: Vamsee Yarlagadda <va...@cloudera.com>
Authored: Fri Aug 18 11:09:20 2017 -0400
Committer: Vamsee Yarlagadda <va...@cloudera.com>
Committed: Fri Aug 18 11:09:20 2017 -0400

----------------------------------------------------------------------
 .../sentry/service/thrift/SentryHMSClient.java       | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/2fa149d1/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryHMSClient.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryHMSClient.java b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryHMSClient.java
index 1d91fc2..4a8fb95 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryHMSClient.java
+++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryHMSClient.java
@@ -144,13 +144,13 @@ class SentryHMSClient implements AutoCloseable {
    * @return Full path snapshot and the last notification id on success
    */
   PathsImage getFullSnapshot() {
-    try {
-      if (client == null) {
-        LOGGER.error(NOT_CONNECTED_MSG);
-        return new PathsImage(Collections.<String, Set<String>>emptyMap(),
-            SentryStore.EMPTY_NOTIFICATION_ID, SentryStore.EMPTY_PATHS_SNAPSHOT_ID);
-      }
+    if (client == null) {
+      LOGGER.error(NOT_CONNECTED_MSG);
+      return new PathsImage(Collections.<String, Set<String>>emptyMap(),
+          SentryStore.EMPTY_NOTIFICATION_ID, SentryStore.EMPTY_PATHS_SNAPSHOT_ID);
+    }
 
+    try {
       CurrentNotificationEventId eventIdBefore = client.getCurrentNotificationEventId();
       Map<String, Set<String>> pathsFullSnapshot = fetchFullUpdate();
       if (pathsFullSnapshot.isEmpty()) {
@@ -215,7 +215,8 @@ class SentryHMSClient implements AutoCloseable {
       return new PathsImage(pathsFullSnapshot, currentEventId,
           SentryStore.EMPTY_PATHS_SNAPSHOT_ID);
     } catch (TException failure) {
-      LOGGER.error("Failed to communicate to HMS");
+      LOGGER.error("Fetching a new HMS snapshot cannot continue because an error occurred during "
+          + "the HMS communication: ", failure.getMessage());
       return new PathsImage(Collections.<String, Set<String>>emptyMap(),
           SentryStore.EMPTY_NOTIFICATION_ID, SentryStore.EMPTY_PATHS_SNAPSHOT_ID);
     }