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 <[email protected]> Authored: Fri Aug 18 11:09:20 2017 -0400 Committer: Vamsee Yarlagadda <[email protected]> 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); }
