morningman commented on code in PR #68220:
URL: https://github.com/apache/doris/pull/68220#discussion_r4057106249


##########
fe/fe-authorization/fe-authorization-plugins/fe-authorization-plugin-ranger-common/src/main/java/org/apache/doris/catalog/authorizer/ranger/RangerAccessController.java:
##########
@@ -35,7 +35,6 @@
 import org.apache.ranger.plugin.policyengine.RangerAccessResourceImpl;
 import org.apache.ranger.plugin.policyengine.RangerAccessResult;
 import org.apache.ranger.plugin.policyengine.RangerAccessResultProcessor;
-import org.apache.ranger.plugin.service.RangerBasePlugin;

Review Comment:
   Fixed in 400194c4517.
   
   `BackgroundLoadedRangerPlugin.awaitLoaded(BooleanSupplier giveUp)` waits on 
the load latch in 100 ms slices and returns as soon as the load has ended or 
`giveUp` says so; `checkPrivilege`, `getRowFilters` and `getDataMasks` now wait 
with `() -> closed`, so a controller closed before or during the wait stops 
waiting and is refused by the existing fence (`checkWhileOpen` / `whileOpen`, 
read lock kept) instead of after the REST timeouts of an admin that is not 
answering. The wait is still taken before the fence and with no lock held, as 
before, and the load itself goes on for whoever else holds the plugin - the 
plugin's `cleanup()` deliberately does not wait for it.
   
   `BackgroundLoadedRangerPluginTest.testAWaitGivesUpWhenAsked` covers the 
plugin side; 
`RangerTest.testACheckWaitingForTheLoadIsRefusedOnceTheControllerIsClosed` 
closes a directly built controller while a `checkPrivilege` and a 
`getRowFilters` are waiting on a load that never ends, and asserts both are 
refused with "has been closed" while the load is still running.
   



-- 
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]

Reply via email to