Repository navigation
🐛 fix(soft): finish settled stale rollback - #1082
Merged
Merged
Conversation
A replaced break name could make unlink raise after rollback had settled. The soft lock now receives that verdict before name cleanup, so it removes its own pending marker by descriptor identity. Fixes #1025
gaborbernat
marked this pull request as draft
November 20, 2026 15:32
gaborbernat
marked this pull request as ready for review
November 20, 2026 18:17
gaborbernat
marked this pull request as draft
November 20, 2026 20:22
gaborbernat
marked this pull request as ready for review
November 20, 2026 20:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A stale-break rollback could settle while another process changed its break name. Deleting that name then raised, so the soft lock left its own marker at the lock path despite reporting no hold. A later acquire could time out on that marker. The soft lock now receives the settled result before break-name cleanup and removes its pending marker by descriptor identity. Fixes #1025.
The cleanup error hid a settled rollback
exchange_backused to unlink the break name before returning.Path.unlink()raises on a directory, so a replaced break name hid the settled result from the caller.exchange_backnow lets the soft-lock caller defer that unlink. The caller attempts the name cleanup after receiving settlement and checks the remaining names against its open descriptor before removing its pending marker.sequenceDiagram participant P as Peer participant C as Contender participant A as Break name participant L as Lock path activate C rect rgb(255, 214, 214) C->>+A: Before: rollback settles A-->>-C: name missing P->>A: replace name C->>+A: unlink changed name A-->>-C: error Note over C,L: Contender's marker stays at lock path end rect rgb(216, 243, 220) C->>+A: After: rollback settles A-->>-C: settled result P->>A: replace name C->>A: attempt name cleanup C->>L: remove pending marker by inode end deactivate CBehavior changes
On POSIX filesystems with atomic name exchange,
SoftFileLock,MarkerSoftFileLock, andSoftFileLeasecan retry after this race without a marker naming the unsuccessful contender. An account that can place a directory at the lock path can still block acquires directly; this change removes the contender-owned residue. Windows does not use this exchange path. The otherexchange_backcaller still propagates break-name deletion errors.Reported by OSS Scanner: ANT-2026-TBM12ZIH.