Repository navigation
🐛 fix(soft): restore markers after interrupted exchange - #1080
Merged
Merged
Conversation
A signal can run after the kernel swaps lock names but before Python records the result. Cleanup then removes the marker at the lock path while a live holder's marker remains under a break name. Arm rollback before the exchange call. Cleanup sees the contender's marker under its break name if no swap occurred, and returns a displaced holder's marker when the swap completed. Fixes #993
gaborbernat
marked this pull request as draft
November 20, 2026 15:32
gaborbernat
marked this pull request as ready for review
November 20, 2026 17:33
gaborbernat
marked this pull request as draft
November 20, 2026 19:32
A failed acquire can leave an empty marker if a signal interrupts its removal. Check which file the exchange moved aside before deciding whether to restore it.
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.
On Linux and macOS filesystems that support atomic name exchange, a signal could interrupt
SoftFileLockafter a marker moved aside but before the exchange returned. An interrupted takeover could then admit a second holder. Cleanup after a failed acquire could also leave an empty file that blocked later callers. Fixes #993.Python signal handlers can raise before an exchange reports success. An interrupted takeover restores the displaced marker. During removal, cleanup checks the displaced file's inode and modification time. Cleanup removes the original marker, including an empty one left by a failed acquire, when both values match. If a peer replaced the marker, cleanup puts the replacement back.
Reported by OSS Scanner (
ANT-2026-3HY24V2J).