You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make async acquire and release cancellation-safe #640
Cancelling an executor-backed acquisition can leave the backend locked with no acquisition counter or deadlock-registry
entry. The worker can finish after the awaiting task has rolled back its state:
Release has an error-channel defect. It shields and awaits the release task, and its state reconciliation keeps is_locked and the counter accurate, but BaseAsyncFileLock.release()
suppresses a release exception after caller cancellation. The caller receives cancellation with no report that the lock
may remain held.
Run each backend acquisition in a shielded task or future. If caller cancellation arrives during an in-flight attempt,
wait for that attempt to finish. Release the backend under a shield if acquisition succeeded, then propagate
cancellation. Retain the counter and registry entry when rollback fails and the backend remains held.
Do not suppress a release error after cancellation. Report both failures through the dual-error policy from #631, preserving the backend error as an independent leaf. Coordinate
descriptor close handling with #633 and registry-key lifetime with #632.
Verification
Use deterministic synchronization points instead of timing sleeps. Cancel before executor start, while the worker is
blocked, after backend acquisition but before state commit, and during rollback. Cover rollback and release failures.
After each case, assert the counter and public state, then use a separate process to test the operating-system lock.
Apply the same cases to AsyncReadWriteLock where its API permits them.
Activity
🐛 fix(async): make cancellation atomic
🐛 fix(async): make cancellation atomic
🐛 fix(async): make cancellation atomic (tox-dev#652)