fix: acquire lock in rr sync to prevent file overwrites during execution#182
fix: acquire lock in rr sync to prevent file overwrites during execution#182rileyhilliard merged 1 commit intomainfrom
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughSync now acquires a distributed lock before performing file synchronization (skipped for dry-run, SkipLock option, or local connections). A new Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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 |
a39d11d to
08275d3
Compare
…ion (#181) rr sync skipped lock acquisition, allowing it to overwrite remote files while another rr process was actively executing. Added lock phase between connect and sync, matching the pattern used by SetupWorkflow. Lock is skipped for dry-run mode and local connections.
08275d3 to
84ee09a
Compare
Summary
Fixes #181
rr syncnow acquires a distributed lock before syncing files, preventing overwrites while anotherrr runorrr <task>is executing on the same hostlock.Acquireis called insync.goBefore:
Connect -> Sync(no lock, could clobber files mid-execution)After:
Connect -> Lock -> Sync -> Release(matchesSetupWorkflowpattern)Test plan
rr verifypasses (lint + all unit tests)TestSync_AcquiresLockBeforeSyncverifies lock acquisition exists in sourcerr run "sleep 30"in one terminal, thenrr syncin another - sync should wait for lockSummary by CodeRabbit
New Features
Tests