sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amis...@apache.org
Subject sentry git commit: SENTRY-2464: Catch exception thrown on first reload for UpdatableCache
Date Wed, 28 Nov 2018 20:50:58 GMT
Repository: sentry
Updated Branches:
  refs/heads/HEAD [created] 2a781897b


SENTRY-2464: Catch exception thrown on first reload for UpdatableCache

Change-Id: I26a95830a7321259fcb0ee2df663abc861f6f9fe


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

Branch: refs/heads/HEAD
Commit: 2a781897b129b89b3f1aa7ebc7f77117c79de3d0
Parents: 987c692
Author: amishra <amishra@cloudera.com>
Authored: Wed Nov 28 11:06:13 2018 -0600
Committer: amishra <amishra@cloudera.com>
Committed: Wed Nov 28 11:06:13 2018 -0600

----------------------------------------------------------------------
 .../apache/sentry/provider/db/generic/UpdatableCache.java   | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/2a781897/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/UpdatableCache.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/UpdatableCache.java
b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/UpdatableCache.java
index 0dd7b4a..a57e2ee 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/UpdatableCache.java
+++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/UpdatableCache.java
@@ -134,7 +134,14 @@ public final class UpdatableCache implements TableCache, AutoCloseable
{
 
   void startUpdateThread(boolean blockUntilFirstReload) throws Exception {
     if (blockUntilFirstReload) {
-      reloadData();
+      try {
+        reloadData();
+      } catch (Exception e) {
+        String logMessage = "Unable to load cache on first reload for component[" +
+            this.componentType + "] serviceName[" + this.serviceName + "]. "
+            + "Cache will load with thread in [" + TimeUnit.NANOSECONDS.toSeconds(this.cacheTtlNs)
+ "]sec";
+        LOGGER.warn(logMessage, e);
+      }
     }
 
     if (initialized) {


Mime
View raw message