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 a57e2ee92..fc46978f5 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 @@ -178,12 +178,12 @@ public void run() { private void revokeAllPrivilegesIfRequired() { if (++consecutiveUpdateFailuresCount > allowedUpdateFailuresCount) { - consecutiveUpdateFailuresCount = 0; // Clear cache to revoke all privileges. // Update table cache to point to an empty table to avoid thread-unsafe characteristics of HashBasedTable. this.table = HashBasedTable.create(); LOGGER.error("Failed to update roles and privileges cache for " + consecutiveUpdateFailuresCount + " times." + " Revoking all privileges from cache, which will cause all authorization requests to fail."); + consecutiveUpdateFailuresCount = 0; } }