Skip to content

RANGER-5210: private variable isPolicyEngineShared is set to wrong value #571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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