-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ENG-8173] share query cache for queries that don't check auth (#32821)
Detect in the isolate whether `ctx.auth.getUserIdentity` is ever called. If not, store the query result with `identity: None` in the query cache. When checking whether a cache entry matches, we first check for the precise identity, and then check if there is an entry with `identity: None`. When updating a cache entry, we add a waiting entry for the precise identity, and when the query completes we remove the waiting entry and insert an entry based on whether the query read the identity. NOTE the part i'm worried about is whether this screws with assumptions, since the waiting entry might not be at the same cache key as the eventual result. I think it's okay because if multiple requests are waiting, they already have to handle the executing request not populating the cache. Added tests which confirm desired behavior. Open to suggestions for more tests. GitOrigin-RevId: f6a2c9cf8607077d62b3e0a89057fff2f9615330
- Loading branch information
Showing
11 changed files
with
287 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.