Repository navigation
🐛 fix(api): roll back interrupted acquisitions - #1060
Merged
Merged
Conversation
This was referenced Nov 20, 2026
gaborbernat
marked this pull request as draft
November 20, 2026 15:32
An interrupted release can resume after another thread has acquired the lock at the same depth. Check the acquisition generation under the transition gate before retrying. Fixes #1004
A signal handler can acquire a peer after the initial deadlock check. Check the pinned path again before waiting on that peer. Fixes #1083
gaborbernat
force-pushed
the
fix/ynl-counter-signal-agent
branch
from
November 20, 2026 15:39
77e4142 to
c2e7855
Compare
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:33
gaborbernat
marked this pull request as ready for review
November 20, 2026 21:28
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.
An exception during
acquire()could leave the caller holding a lock it never received (#1030). Synchronous and asynchronous acquires now roll back the new hold. If rollback fails, the acquire reports the cleanup error and retains the hold for an explicitrelease(). A failed nested acquire restores the earlier depth. Fixes #1030.During a synchronous acquire, a hook or signal handler may enter and leave its own nested
with lock:block. Releasing the level that the interrupted acquire is taking raisesRuntimeError. A forced release drops every level, and the interrupted acquire raisesRuntimeErrorif it observes that release. Fixes #1071. Fixes #1076.flowchart TD A["First acquire starts"] --> B["Backend takes lock"] B --> C{"Hook completes?"} C -->|Yes| D["Return hold to caller"] C -->|Raises| E["Roll back provisional hold"] E --> F{"Unlock succeeds?"} F -->|Yes| G["Peer can acquire"] F -->|No| H["Caller can retry release"] classDef step fill:#cfe4ff,stroke:#1f6feb,color:#0b1f3a classDef decision fill:#ffe3a3,stroke:#d29200,color:#3a2c00 class A,B,D,E,G,H step class C,F decisionAn interrupted release checks that it still owns the same hold before retrying. A waiter also checks whether its own signal handler acquired another instance on the same path before sleeping again. This lets it report a deadlock while the handler's hold is still live. Fixes #1004. Fixes #1083.
The original count error was reported as ANT-2026-YNLBMYLA.