Repository navigation
fix(storage): release recovery writer locks on error exits (#1283) - #1284
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. 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 |
A cleanup resource-limit error dropped the parent writer-lock file without explicitly unlocking it. A duplicated or fork-inherited descriptor could therefore keep the kernel lock alive and make the next writer receive
GF_WRITER_BUSY.Return a private writer-lock guard from recovery-lock acquisition. Its error-path destructor explicitly unlocks; successful paths retain fallible explicit release and close the file before project-root deletion. All four retention/recovery callers preserve checkpoint-before-writer release order and allocation accounting.
Two deterministic regressions keep a duplicate of the production writer descriptor alive across
max_entriesandmax_bytes_scannederrors. Both failed on the prior implementation withGF_WRITER_BUSY. They require independent writer acquisition and a repeated public cleanup preview while the duplicate remains open. Existing genuine-contention coverage remains enabled. This proves the ownership defect; fork inheritance as the trigger of the earlier CI occurrence remains an inference.Validation:
cargo test --locked --release -p graphforge-storage project_retention::tests -- --test-threads=4passed all 15 tests. The same optimized storage test executable passed all 29 recovery tests with four test threads. The pre-fixduplicated_writer_lockfilter failed both tests as expected. Workspace Clippy, formatting andmake pre-push-fastpass; independent review found no actionable findings. No public API, durable-format, RSS-policy, or scale-workload change.Closes #1283. Prerequisite for completing #1278 via PR #1281.