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
The lock (at least RWLockWrite, have not tested with others) has consistent issues with poorly timed KeyboardInterrupts (and presumably other interrupting signals) that arrive during acquire, at least on Windows.
Specifically, if a keyboard interrupt is received during the write lock's acquire (did not test read lock's acquire):
A following release() will yield an exception "released unlocked lock", yet
A subsequent acquire() - from either a write or read lock - will deadlock.
Therefore the lock is left in an unrecoverable state after acquire is interrupted.
The following program reproduces the issue on Windows 10 with Python 3.11.1 and readerwriterlock 1.0.9:
Pressing Ctrl-C during the loop is more likely than not to leave the lock in this indeterminate state.
The ultimate consequence, in my case anyways, is that terminating an application cleanly in response to an interrupt signal becomes tricky, as workarounds need to be put in place to handle the possibility of deadlocks as well as handle the "released unlock lock" exception.
Activity
Morphlng commentedon Dec 22, 2024
Same issue encountered with
RWLockFair