roryqi opened a new pull request, #12976:
URL: https://github.com/apache/gravitino/pull/12976

   ### What changes were proposed in this pull request?
   
   Rethrow the original `Error` from `PrincipalUtils.doAs` after logging it,
   instead of wrapping it in a `RuntimeException`.
   
   Add a unit test to verify that the original error instance is preserved.
   
   ### Why are the changes needed?
   
   Wrapping fatal JVM errors such as `OutOfMemoryError` in a
   `RuntimeException` changes their classification and prevents callers and
   error handlers from recognizing the actual failure.
   
   Fix: #12975
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Errors thrown by privileged actions retain their original type instead
   of being exposed as `RuntimeException`.
   
   ### How was this patch tested?
   
   Ran:
   
   `./gradlew :core:spotlessApply :core:test --tests 
org.apache.gravitino.utils.TestPrincipalUtils`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to