adutra commented on issue #541:
URL: https://github.com/apache/polaris/issues/541#issuecomment-2562951472

   Investigating this a bit more, I think the most problematic aspects are:
   
   1 `RealmTokenBucketRateLimiter`, because this filter kicks in _before_ the 
authenticating filter, thus executing itself for any request, even 
unauthenticated. Since it holds a map of token buckets per realm, this map can 
grow uncontrollably.
   2. The tokens endpoint, because this resource is not protected by the 
authenticating filter and is invoked for every request, even unauthenticated, 
thus potentially growing the internal maps in 
`LocalPolarisMetaStoreManagerFactory`.
   
   On the bright side, I _think_ that the internal maps would not grow 
uncontrollably in a "real-life" scenario with EclipseLink and a real database, 
because the realm initialization would fail on an unknown realm:
   
   
https://github.com/apache/polaris/blob/aee3a027b3e3d4e1f4365faea3e9bcff9df849df/extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreSessionImpl.java#L181
   
   And that initialization would be triggered by the 
`DefaultCallContextResolver` that is invoked in the 
`PolarisApplication.ContextResolverFilter`, which is the very first filter to 
execute. So I believe that un unknown realm would throw an exception here:
   
   
https://github.com/apache/polaris/blob/b8446866b55e79c35c6505681c871e22f8a86634/dropwizard/service/src/main/java/org/apache/polaris/service/dropwizard/PolarisApplication.java#L510
   
   That said, it still feels a bit fragile to attempt to create a meta store 
session for any realm, even unknown, even if from an unauthenticated request, 
only to see the attempt fail.
   
   (Also, EclipseLink with the default `jdbc:h2:file` datasource is likely to 
create meta store sessions for any realm without any form of verification.)


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