Skip to content

fix(dash-spv): derive storage lockfile path from full directory name#862

Merged
QuantumExplorer merged 1 commit into
devfrom
claude/agitated-cori-c55968
Jul 10, 2026
Merged

fix(dash-spv): derive storage lockfile path from full directory name#862
QuantumExplorer merged 1 commit into
devfrom
claude/agitated-cori-c55968

Conversation

@QuantumExplorer

Copy link
Copy Markdown
Member

Problem

DiskStorageManager::new derived its data-directory lockfile with storage_path.set_extension("lock"). When the storage path's final component contains a dot (e.g. probes/95.183.53.19-9999), set_extension replaces everything after the last dot — so probes/95.183.53.19-9999 and probes/95.183.53.20-9999 both derived probes/95.183.53.lock, and distinct data directories spuriously failed with Data directory ... is already in use by another process.

Discovered via the spv-network-health probe tool, which uses per-peer ip-port directory names.

Fix

Build the lock path by appending .lock to the full final path component (via OsString::push + with_file_name, since Path::add_extension is unstable on the pinned toolchain). Dot-free paths behave exactly as before (discoverydiscovery.lock). Paths with no final component keep the previous set_extension behavior.

Tests

  • Unit test asserting dotted sibling directory names produce distinct lock paths, and that dot-free names are unchanged.
  • Async test opening two 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, and cargo fmt --check all clean.

🤖 Generated with Claude Code

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>
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@QuantumExplorer, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 41 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 32679d5b-f985-43be-8852-72c276ad17f4

📥 Commits

Reviewing files that changed from the base of the PR and between 1860089 and a5865bb.

📒 Files selected for processing (1)
  • dash-spv/src/storage/mod.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/agitated-cori-c55968

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.62500% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.62%. Comparing base (1860089) to head (a5865bb).

Files with missing lines Patch % Lines
dash-spv/src/storage/mod.rs 90.62% 3 Missing ⚠️
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     
Flag Coverage Δ
core 77.08% <ø> (ø)
ffi 46.07% <ø> (-0.02%) ⬇️
rpc 20.00% <ø> (ø)
spv 91.04% <90.62%> (-0.03%) ⬇️
wallet 73.05% <ø> (ø)
Files with missing lines Coverage Δ
dash-spv/src/storage/mod.rs 87.22% <90.62%> (+0.19%) ⬆️

... and 5 files with indirect coverage changes

@QuantumExplorer
QuantumExplorer merged commit 0786810 into dev Jul 10, 2026
59 of 60 checks passed
@QuantumExplorer
QuantumExplorer deleted the claude/agitated-cori-c55968 branch July 10, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants