Skip to content

Conversation

vyommani
Copy link
Contributor

@vyommani vyommani commented May 8, 2025

What changes were proposed in this pull request?

In the RangerBasePlugin class, the isPolicyEngineShared variable is incorrectly set to true even when the policy engine instance isn't shared.

When delta sync is enabled, the PolicyRefresher downloads modified policies and updates the policy engine. If locking is enabled, it updates the existing policy engine instance; otherwise, it creates a new instance.

The setPolicies method creates a new policy engine instance by calling RangerPolicyEngineImpl.getPolicyEngine. However, this method might return the same instance, not a new one.

The isPolicyEngineShared flag is set to true if newPolicyEngine isn't null, which is incorrect. Instead, it should be set to true only if newPolicyEngine is the same instance as the old policy engine.

How was this patch tested?

I tested locally as follows
mvn clean install

@kumaab
Copy link
Contributor

kumaab commented May 14, 2025

@vyommani please rebase PR to re-run the CI checks, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants