tirkarthi commented on issue #60265:
URL: https://github.com/apache/airflow/issues/60265#issuecomment-3733406659

   I have updated my PR to use TTLCache from cachetools is used to ensure the 
cached user objects expire to be fetched again. The TTL value is configurable 
through `fab.cache_ttl` configuration with a default of 30 seconds. Each worker 
and instance of auth manager has its own cache and they are not persisted to be 
reset as workers restart. In case this needs to be disabled then users can set 
the cache_ttl as 0. I have added test to ensure the cache is expired. In case 
of deployments with frequent roles and permission changes users can set this to 
lower value at the cost of frequent db queries. For deployments with lesser 
number of changes to roles and permissions this can be set to a higher value 
for better performance. This should mitigate the need to invalidate caches on 
roles and permission changes. If required this can be documented with more 
detail in changelog just to avoid confusion.
   
   https://cachetools.readthedocs.io/en/latest/#cachetools.cachedmethod


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