Nir Soffer has submitted this change and it was merged.
Change subject: guarded: Raise if attempt to lock will deadlock ......................................................................
guarded: Raise if attempt to lock will deadlock
Previously we did not validate that the same lock was submitted in different modes, since we assumed that resourceManager will fail. Turns out that resourceManager will simply deadlock.
This patch validates the locks and raise a guarded.Deadlock in this case, without taking any locks.
Here is an example exception (wrapped):
Deadlock: Attempt to lock will deadlock: [ <FakeGuardedLock ns=02_img.dom, name=img, mode=exclusive at 0x7fab62093110>, <FakeGuardedLock ns=02_img.dom, name=img, mode=shared at 0x7fab620931d0>]
Change-Id: I5cd539548eda04ac7b9faf0ba1be49f29bfa2ed0 Signed-off-by: Nir Soffer nsoffer@redhat.com Reviewed-on: https://gerrit.ovirt.org/64977 Reviewed-by: Adam Litke alitke@redhat.com --- M lib/vdsm/storage/guarded.py M tests/storage_guarded_test.py 2 files changed, 46 insertions(+), 1 deletion(-)
Approvals: Adam Litke: Looks good to me, approved Nir Soffer: Verified; Passed CI tests
Objections: Jenkins CI: Failed CI tests