fix(dash-spv): derive storage lockfile path from full directory name#862
Conversation
DiskStorageManager::new used Path::set_extension("lock") to derive the
data-directory lockfile. For directory names containing dots (e.g.
probes/95.183.53.19-9999), set_extension replaces everything after the
last dot, so distinct sibling directories collided on the same lockfile
and spuriously failed with "Data directory ... is already in use by
another process".
Append ".lock" to the full final path component instead. Dot-free
paths are unchanged (discovery -> discovery.lock).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 41 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ 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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #862 +/- ##
==========================================
- Coverage 73.62% 73.62% -0.01%
==========================================
Files 324 324
Lines 73195 73223 +28
==========================================
+ Hits 53888 53908 +20
- Misses 19307 19315 +8
|
Problem
DiskStorageManager::newderived its data-directory lockfile withstorage_path.set_extension("lock"). When the storage path's final component contains a dot (e.g.probes/95.183.53.19-9999),set_extensionreplaces everything after the last dot — soprobes/95.183.53.19-9999andprobes/95.183.53.20-9999both derivedprobes/95.183.53.lock, and distinct data directories spuriously failed withData directory ... is already in use by another process.Discovered via the spv-network-health probe tool, which uses per-peer
ip-portdirectory names.Fix
Build the lock path by appending
.lockto the full final path component (viaOsString::push+with_file_name, sincePath::add_extensionis unstable on the pinned toolchain). Dot-free paths behave exactly as before (discovery→discovery.lock). Paths with no final component keep the previousset_extensionbehavior.Tests
DiskStorageManagers on dotted sibling directories — failed with the spurious lock conflict before the fix.cargo test -p dash-spv --lib storage(58 passed),cargo clippy -p dash-spv --all-targets --all-features -- -D warnings, andcargo fmt --checkall clean.🤖 Generated with Claude Code