Repository navigation
fix(id): bound PresenceTable with stale-only eviction - #4160
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 53 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Reworked to the recorded #4502 Phase 2 decision (#4004)
Branch merged up to current Tests
Review findingsCodex did not review this commit — its run failed on the account's review usage limit and reported no findings, so there is nothing to disposition from it. CIThe |
Updated the implementation and tests to match this decision: |
…(salvage of PR #4160 onto current main) Port of the PR #4160 fix (commits 7888205 + 67a2b78) onto current main: the original branch had diverged (1016 files dirty vs main). MAX_PRESENCE_NODES = 1_000; at capacity a new node is admitted only by evicting the oldest expired entry (expiry from the effective stamp, #8865), ties broken by node key bytes; if every entry is fresh the new node is refused. Existing nodes refresh in place. Three bound tests ported from PR #4160; cargo test --lib chat_presence 26/26 pass. Fixes #4004. Task 8482.
67a2b78 to
6b99c3a
Compare
|
🤖 Agent note · branch salvaged onto current main — queue worker (repo-worker-code), lane code-b, task 8482. PR #4160's branch had diverged from main beyond repair (mergeable_state dirty; 1,016 files / +148k/-118k vs main, from an old-tree merge in its history), though its actual fix was always a single file. This shift salvaged it:
|
Summary
Bounds
PresenceTabletoMAX_PRESENCE_NODES = 1_000, aligned with discovery. At capacity, new node keys are admitted only by evicting an entry already past its TTL (oldest heartbeat first, key bytes as tie-breaker); if all entries are fresh, the new node is refused. An existing node refreshes in place, subject to the existing timestamp ordering guard.The implementation is in
pkgs/id/src/chat_presence.rs. Regression tests use distinct signed keys and cover the cap under over-cap insertion, refusal when full of fresh entries, stale-only eviction, deterministic key-byte ties, existing-node refresh, and the ordering guard. The current-main wire-decoded channel/typing sanitization tests are preserved.Fixes #4004. Decision: design #4502 Phase 2, pinned on issue #4004.