Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Assumption that cache eviction does not happen #544

Open
snazy opened this issue Dec 12, 2024 · 1 comment
Open

[BUG] Assumption that cache eviction does not happen #544

snazy opened this issue Dec 12, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@snazy
Copy link
Member

snazy commented Dec 12, 2024

From #465: "The existing code assumes that all of the entities are in the cache once the Resolver runs. That process puts all of the entities and their grants into the cache so that by the time the Authorizer retrieves the grants, it fetches them from the cache."

It sounds like that the code really relies on the entities being available from the cache, which means that no eviction must happen. If eviction happens (which must be assumed to happen at any point in time to any cache entry) requests can fail at any time w/ misleading errors and/or wrong information.

@snazy snazy added the bug Something isn't working label Dec 12, 2024
@collado-mike
Copy link
Contributor

At least in the linked PR, all cache lookups invoke entityCache.getOrLoadEntityById - this will validate that the cache entry is present and do the lookup if it is not. The "assumption" mentioned is on the performance characteristics, not the correctness of the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants