Let auth profile locks reach stale reclaim#2321
Conversation
📝 WalkthroughWalkthroughThe PR refactors the auth-profile lock timeout constant from a hardcoded 10,000 ms value to a derived computation based on ChangesLock Timeout Constant Derivation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning Review ran into problems🔥 ProblemsStopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a 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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/openhuman/credentials/profiles.rs (1)
596-622: ⚡ Quick winUpdate the remaining hardcoded
10swording in this lock-wait comment.Line 621 still says “the 10s timeout,” which is now stale after deriving
LOCK_TIMEOUT_MSfromSTALE_LOCK_AGE_MS + 5_000. Align it toLOCK_TIMEOUT_MSfor consistency with the rest of the block.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/openhuman/credentials/profiles.rs` around lines 596 - 622, The inline comment referring to "the 10s timeout" is stale; update that wording to reference the LOCK_TIMEOUT_MS constant (or phrase it as "the LOCK_TIMEOUT_MS timeout" / "the configured LOCK_TIMEOUT_MS") so the comment in the lock-wait loop that surrounds clear_lock_if_stale(), cleared_stale, started_at, next_stale_recheck_ms and the derived STALE_LOCK_AGE_MS + 5_000 logic stays accurate and consistent with the implementation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/openhuman/credentials/profiles.rs`:
- Around line 596-622: The inline comment referring to "the 10s timeout" is
stale; update that wording to reference the LOCK_TIMEOUT_MS constant (or phrase
it as "the LOCK_TIMEOUT_MS timeout" / "the configured LOCK_TIMEOUT_MS") so the
comment in the lock-wait loop that surrounds clear_lock_if_stale(),
cleared_stale, started_at, next_stale_recheck_ms and the derived
STALE_LOCK_AGE_MS + 5_000 logic stays accurate and consistent with the
implementation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fd0d53be-a47c-40bb-8d4d-e7f540603b8f
📒 Files selected for processing (2)
src/openhuman/credentials/profiles.rssrc/openhuman/credentials/profiles_tests.rs
|
@senamakel #2321 当前 checks 24 success / 3 skipped / 0 pending / 0 failure,CodeRabbit 最新 review approved,review threads 0 unresolved,mergeable。这个是 auth profile lock timeout 的 critical 修复,麻烦再看一下。 |
|
nice one @aqilaziz, letting the wait horizon stretch past the stale threshold so leaked locks can actually get reclaimed is such a clean fix 🙌 love that you locked it in with a regression test too so the recovery path stays reachable. thanks for keeping at it! |
Summary
STALE_LOCK_AGE_MS + 5s.Problem
Timed out waiting for auth profile lock.Solution
LOCK_TIMEOUT_MSfromSTALE_LOCK_AGE_MS + 5_000.Submission Checklist
diff-cover) meet the gate enforced by.github/workflows/coverage.yml. Runpnpm test:coverageandpnpm test:rustlocally; PRs below 80% on changed lines will not merge.## RelatedCloses #NNNin the## RelatedsectionImpact
Related
AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
Validation Run
pnpm --filter openhuman-app format:check— N/A: no frontend files changed.pnpm typecheck— N/A: no TypeScript files changed.cargo test -p openhuman credentials::profiles --lib.cargo fmt --all --check;git diff --check.app/src-taurifiles changed.Validation Blocked
command:cargo test -p openhuman credentials::profiles --liberror:whisper-rs-sysbuild could not findclang.dll/libclang.dll;LIBCLANG_PATHis not set in this local Windows environment.impact:The targeted Rust test binary did not run locally; CI has the Linux Rust toolchain/image and should execute it.Behavior Changes
auth-profiles.lockfiles.Parity Contract
Duplicate / Superseded PR Handling
Summary by CodeRabbit
Refactor
Tests