[#12901] fix(authz): Keep preloadOwner best-effort when GravitinoEnv is uninitialized - #12869
Open
laserninja wants to merge 1 commit into
Open
[#12901] fix(authz): Keep preloadOwner best-effort when GravitinoEnv is uninitialized#12869laserninja wants to merge 1 commit into
laserninja wants to merge 1 commit into
Conversation
Code Coverage Report
Files
|
…noEnv is uninitialized MetadataAuthzHelper.preloadOwner resolved the entity store outside its try block. GravitinoEnv.entityStore() throws IllegalArgumentException when the environment is not initialized, so that exception escaped a warm-up whose failure is meant to be ignored, and it failed the whole list request.
laserninja
force-pushed
the
fix/authz-preload-owner-best-effort
branch
from
September 3, 2026 16:37
b30c958 to
d716586
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Move the entity-store lookup in
MetadataAuthzHelper.preloadOwnerinside its existingtryblock.Why are the changes needed?
preloadOwneris a best-effort cache warm-up - itscatch (Exception e)logs and ignores any failure. ButGravitinoEnv.getInstance().entityStore()was called outside thetry, and that method throwsIllegalArgumentException("GravitinoEnv is not initialized."). The exception therefore escaped the warm-up, propagated out offilterByExpression, and failed the entire list request with a 400.This already breaks three tests in
server, which return 400 instead of 200:Fix: #12901
Does this PR introduce any user-facing change?
No.
How was this patch tested?
:server:testgoes from 3 failures to 0 (323 tests).TestMetadataObjectTagOperations#testListTagsForObject,#testListTagsForObjectUnderHierarchicalSchema, and#testListTagsDeduplicatesDifferentAssignmentValuespass again.