rich7420 commented on PR #10469:
URL: https://github.com/apache/ozone/pull/10469#issuecomment-4965536180
Thanks a lot @ChenSammi for catching this and looking into it. You're right
that internal non-RPC requests need careful handling, and I want to make sure
we don't break them.
I spent some time tracing the internal paths, and so far they look covered
to me, but please correct me if I'm missing a case.
From what I can tell, preExecute() (where a write request calls
createUGIForApi()) only runs on the RPC path through OMExecutionFlow.submit().
The internal writes I could find, like QuotaRepairTask and the background
deletion and cleanup services, call ratisServer.submitRequest(...) directly, so
they skip preExecute() and never build a UGI from an empty user. The one
internal path I found that does call preExecute() explicitly is the Trash
emptier in TrashOzoneFileSystem, and it already sets its own UserInfo with the
OM login user, which getUserInfo() keeps.
To double check the trickiest case end to end, I wrote a small test that
runs QuotaRepairTask.repair() with no RPC or gRPC user and no UserInfo, on an
ACL enabled OM, and it passes without hitting UNAUTHORIZED: [commit link]. I'm
happy to turn it into a proper follow up PR if that helps. You probably have a
specific case in mind that I haven't spotted. If you can point me to it, I'd be
glad to add coverage for it, or set its UserInfo explicitly the way Trash does.
And I'm totally fine reverting if that turns out to be the safest path. I just
wanted to share what I found first in case it helps us avoid it. Thanks again!
https://github.com/apache/ozone/commit/7f1408d60dbe27ff470543bdc930dc8a32f67499
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]