Repository navigation
fix(users): never cache a session_version read that a revocation raced; single-flight fills - #863
Merged
Merged
Conversation
…d; single-flight fills Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
Deploying simple-module-python with
|
| Latest commit: |
1622839
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://052fda7d.simple-module-python.pages.dev |
| Branch Preview URL: | https://fix-users-session-version-si.simple-module-python.pages.dev |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #832 and #839. The users session-revocation cache (
users.accounts.session_version_cache) now fills throughsimple_module_core.singleflight.fill, the epoch-checked fill the tenants and permissions caches already use.Fixed: a
session_versionread still in flight when a revocation landed ("sign out everywhere", a password change, a browser logout) was stored after the forget. That put the old counter back, so the revoked sessions passed in that worker until the cache TTL (30 s by default) expired. Every forget, clear and TTL reconfiguration now bumps an epoch, and a read that an epoch change raced is not stored. The read is retried, up toMAX_FILL_ATTEMPTStimes.Changed: concurrent misses for one account share a single read (
SingleFlight), so a page that fires several requests on a cold cache makes one DB read.Unchanged:
Tests
modules/users/tests/accounts/session_version/test_users_session_version_fill.py:Verification
make lintgreen.make test-py: 8,147 passed, 47 skipped.make test-js: 898 passed.https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4