Liron Ar has posted comments on this change. Change subject: resourceManager: Keep resource state if registerResource fails ......................................................................
Patch Set 1: (4 comments) http://gerrit.ovirt.org/#/c/25284/1/tests/resourceManagerTests.py File tests/resourceManagerTests.py: Line 28: Line 29: import storage.resourceManager as resourceManager Line 30: from testrunner import VdsmTestCase as TestCaseBase Line 31: from testValidation import slowtest, stresstest Line 32: import monkeypatch this import should be with the non vdsm imports group Line 33: Line 34: Line 35: class NullResourceFactory(resourceManager.SimpleResourceFactory): Line 36: """ Line 221: # And it should not leave a locked resource Line 222: with self.manager.acquireResource("string", "test", Line 223: resourceManager.LockType.exclusive, Line 224: 0): Line 225: pass the only difference between those methos is the lock type, please export the common logic to a helper method that'll accept the lock type as parameter. Line 226: Line 227: def testRegisterResourceFailureShared(self): Line 228: # This regeisterion must fail Line 229: with monkeypatch.MonkeyPatchScope( Line 741: Line 742: Line 743: def FakeRequestRef(*a, **kw): Line 744: """ Used to simulate failures when registering a resource """ Line 745: raise Failure() when you add the test helper method, those can be defined within. http://gerrit.ovirt.org/#/c/25284/1/vdsm/storage/resourceManager.py File vdsm/storage/resourceManager.py: Line 574: Line 575: self._log.debug("Resource '%s' is currently locked, " Line 576: "Entering queue (%d in queue)", Line 577: fullName, len(resource.queue) + 1) Line 578: ref = RequestRef(request) please move this line to be before the log Line 579: resource.queue.insert(0, request) Line 580: return ref Line 581: Line 582: # TODO : Creating the object inside the namespace lock causes -- To view, visit http://gerrit.ovirt.org/25284 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I16abf41ebc8a8a99b292d38c945074752254a34b Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer <nsof...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Antoni Segura Puimedon <asegu...@redhat.com> Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com> Gerrit-Reviewer: Daniel P. Berrange <berra...@redhat.com> Gerrit-Reviewer: Federico Simoncelli <fsimo...@redhat.com> Gerrit-Reviewer: Liron Ar <lara...@redhat.com> Gerrit-Reviewer: Saggi Mizrahi <smizr...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches