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 (Arjun Mishra reviewed by Na Li, Sergio Pena, and Haley Reeve)
Date Thu, 29 Nov 2018 16:35:36 GMT
Repository: sentry
Updated Branches:
  refs/heads/master 987c692d6 -> 0a609faba


SENTRY-2464: Catch exception thrown on first reload for UpdatableCache (Arjun Mishra reviewed
by Na Li, Sergio Pena, and Haley Reeve)

Change-Id: Ia114d6881870960d60fe5b72e19276f6583bedad


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

Branch: refs/heads/master
Commit: 0a609faba761daa62a330cab5e2c74d70105419b
Parents: 987c692
Author: amishra <amishra@cloudera.com>
Authored: Wed Nov 28 14:49:59 2018 -0600
Committer: amishra <amishra@cloudera.com>
Committed: Wed Nov 28 14:49:59 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/0a609fab/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