Change in vdsm[master]: Add ResourceLocker
nsoffer at redhat.com
nsoffer at redhat.com
Wed Jul 15 18:48:08 UTC 2015
Nir Soffer has posted comments on this change.
Change subject: Add ResourceLocker
......................................................................
Patch Set 2:
(1 comment)
https://gerrit.ovirt.org/#/c/43554/2/vdsm/storage/resourceLocker.py
File vdsm/storage/resourceLocker.py:
Line 40: if len(self._resources) >= LOCK_CACHE_SIZE:
Line 41: self._drop_cached_lock()
Line 42: if res not in self._resources:
Line 43: self._resources[res] = RWLock()
Line 44: self._resources[res].acquire(exclusive)
> If this blocks, nobody can acquire any resource. This must be out of the lo
To support timed acquire, we can use the new rwlock that support timeouts (https://gerrit.ovirt.org/42909).
When an underlying lock times out, it may be caused by a deadlock. we can catch the rwlock.Timeout error here, and dump the internals of all locks, or detect if a possible deadlock (other thread holding the lock that timed out, waiting for a lock we are holding).
Line 45:
Line 46: def releaseResource(self, res):
Line 47: with self._lock:
Line 48: self._resources[res].release()
--
To view, visit https://gerrit.ovirt.org/43554
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I29589889efd39920d72979e89405ff6cf36b803b
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list