Skip to content

RANGER-5602: Local build failure due to unit test failure in TestPolicyACLs#950

Open
vyommani wants to merge 1 commit into
apache:masterfrom
vyommani:RANGER-5602
Open

RANGER-5602: Local build failure due to unit test failure in TestPolicyACLs#950
vyommani wants to merge 1 commit into
apache:masterfrom
vyommani:RANGER-5602

Conversation

@vyommani
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Switched Delegate from lazy computeIfAbsent to eager initialization in the constructor. All internal maps are now fully populated and wrapped with unmodifiableMap before the Delegate is published to the cache.

This eliminates the CME because HashMap.get() is thread-safe for concurrent reads when there are no writes. The previous computeIfAbsent caused concurrent writes on a shared HashMap when multiple threads accessed the same cached Delegate, which parallelStream exposed

How was this patch tested?

after fix mvn test -Dtest=TestPolicyACLs#testResourceACLs_dataMask is passing.

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.

1 participant