From 55d6e7ccdf38a6490a3ec245356e3f94adf0e7b1 Mon Sep 17 00:00:00 2001 From: Nikhil Soni Date: Tue, 14 Jan 2025 19:17:11 +0530 Subject: [PATCH] Throw exception if policy engine is null This will allow lastrefesh time to reflect the fact that policies are not yet updated --- .../java/org/apache/atlas/plugin/service/RangerBasePlugin.java | 1 + 1 file changed, 1 insertion(+) diff --git a/auth-agents-common/src/main/java/org/apache/atlas/plugin/service/RangerBasePlugin.java b/auth-agents-common/src/main/java/org/apache/atlas/plugin/service/RangerBasePlugin.java index af0aa716e1..0c86b8b89d 100644 --- a/auth-agents-common/src/main/java/org/apache/atlas/plugin/service/RangerBasePlugin.java +++ b/auth-agents-common/src/main/java/org/apache/atlas/plugin/service/RangerBasePlugin.java @@ -324,6 +324,7 @@ public void setPolicies(ServicePolicies policies) { if (defaultSvcPolicies == null) { LOG.error("Could not get default Service Policies. Keeping old policy-engine! This is a FATAL error as the old policy-engine is null!"); isNewEngineNeeded = false; + throw new RuntimeException("PolicyRefresher("+policies.getServiceName()+").setPolicies: fetched service policies contains no policies or delta and current policy engine is null"); } else { defaultSvcPolicies.setPolicyVersion(policies.getPolicyVersion()); policies = defaultSvcPolicies;