Repository navigation
🐛 fix(soft-rw): isolate async lock workers - #1037
Closed
gaborbernat wants to merge 1 commit into
Closed
gaborbernat wants to merge 1 commit into
gaborbernat wants to merge 1 commit into
Conversation
A wait on one async soft read/write lock could occupy the event loop's default pool while another lock's release remained queued. Give each default wrapper an owned worker so the blocked wait cannot delay that release. Caller-supplied executors remain caller-owned and need enough capacity for concurrent waits and releases.
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.
With
executor=None,AsyncSoftReadWriteLockused the event loop's default executor. A blocked wait could occupy that shared pool and delay the release of an unrelated lock. Each default wrapper now owns a worker, so its wait cannot consume another wrapper's release capacity. This addresses draft advisory ANT-2026-O69ASZD0.Shared executor stalled unrelated releases
The old submission path passed
Nonetoloop.run_in_executor. A waiting lock could fill the loop's default pool before a different lock submitted its release. The new default assigns one worker to each wrapper.close()requests shutdown without depending on the loop's default executor.sequenceDiagram participant A as Waiting lock participant E as Loop default worker participant B as Unrelated lock rect rgb(255, 226, 226) A->>+E: wait for lock B->>E: queue release Note over E,B: release waits for the worker E-->>-A: wait ends E-->>B: release runs end participant W as Waiting lock worker participant R as Release lock worker rect rgb(226, 245, 226) A->>+W: wait for lock B->>+R: release R-->>-B: release completes W-->>-A: wait ends endBehavior changes
The default creates a worker thread on its first backend call and requests its shutdown on
close()or collection. A caller-supplied executor remains caller-owned and must have capacity for releases while other calls wait in that pool. The change does not isolate separate wrappers that share the same caller-supplied executor.Reported by OSS Scanner: ANT-2026-O69ASZD0.