Skip to content

fix(view): implement partial lock cleanup in lockFile#62349

Draft
joshtrichards wants to merge 1 commit into
masterfrom
jtr/fix-view-lockFile-rollback
Draft

fix(view): implement partial lock cleanup in lockFile#62349
joshtrichards wants to merge 1 commit into
masterfrom
jtr/fix-view-lockFile-rollback

Conversation

@joshtrichards

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

Make View::lockFile() roll back locks it has already acquired when acquiring a later parent lock fails.

Previously, lockFile() could leave the target path and earlier parent locks held after a later parent-lock acquisition failed. The method now tracks successful acquisitions and releases them in reverse order before rethrowing the original failure. Rollback is best-effort: cleanup failures are logged without masking the acquisition failure.

This complements the cache-refresh cleanup change (#62345) by ensuring lockFile() does not leave a partial lock set behind when acquisition itself fails.

TODO

  • Add test: parent-lock acquisition failure releases the file and already-acquired parents
  • Add test: a rollback unlock failure does not replace the acquisition exception

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Josh <josh.t.richards@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant