Nir Soffer has uploaded a new change for review.
Change subject: sp: Streamline building domains list for upgrade
......................................................................
sp: Streamline building domains list for upgrade
Instead of creating a list of domain uuids, and removing the master
domain uuid, remove the master the domain uuid from the domains dict.
This avoids noisy exception handler and using \ continuation.
While touching this code, also fix the log, we are not marking *all*
domains for upgrade but only active domains.
Change-Id: I2be0a4816d733fdae13bcb933201b1ede795ca68
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/storage/sp.py
1 file changed, 4 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/43/65043/1
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 8e0b4bd..ef2e9a28 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -426,13 +426,10 @@
self._convertDomain(self.masterDomain,
str(targetDomVersion))
- self.log.debug("Marking all domains for upgrade")
- self._domainsToUpgrade = self.getDomains(activeOnly=True)\
- .keys()
- try:
- self._domainsToUpgrade.remove(self.masterDomain.sdUUID)
- except ValueError:
- pass
+ self.log.debug("Marking active domains for upgrade")
+ domains = self.getDomains(activeOnly=True)
+ domains.pop(self.masterDomain.sdUUID, None)
+ self._domainsToUpgrade = domains.keys()
self.log.debug("Registering with state change event")
self.domainMonitor.onDomainStateChange.register(
--
To view, visit https://gerrit.ovirt.org/65043
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2be0a4816d733fdae13bcb933201b1ede795ca68
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Nir Soffer has uploaded a new change for review.
Change subject: sp: Do not use rm.acquireResource return value
......................................................................
sp: Do not use rm.acquireResource return value
resourceManager.acquireResource is returning now a Resource object,
which can be used as a context manager. This usage is deprecated, as we
want to replace resourceManager with something much simpler.
Replace such code with usage of rm.acquireResource as a context manger.
This usage will be the only usage allowed in the future.
Change-Id: I8ff5653f0b15861d2034011f7fccc76bf25788f6
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/storage/sp.py
1 file changed, 8 insertions(+), 16 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/42/65042/1
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 11b3287..8e0b4bd 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -1678,10 +1678,8 @@
Upload an image to a remote endpoint using the specified method and
methodArgs.
"""
- imgResourceLock = rm.acquireResource(
- sd.getNamespace(sc.IMAGE_NAMESPACE, sdUUID), imgUUID, rm.SHARED)
-
- with imgResourceLock:
+ img_ns = sd.getNamespace(sc.IMAGE_NAMESPACE, sdUUID)
+ with rm.acquireResource(img_ns, imgUUID, rm.SHARED):
return image.Image(self.poolPath) \
.upload(methodArgs, sdUUID, imgUUID, volUUID)
@@ -1690,10 +1688,8 @@
Download an image from a remote endpoint using the specified method
and methodArgs.
"""
- imgResourceLock = rm.acquireResource(
- sd.getNamespace(sc.IMAGE_NAMESPACE, sdUUID), imgUUID, rm.EXCLUSIVE)
-
- with imgResourceLock:
+ img_ns = sd.getNamespace(sc.IMAGE_NAMESPACE, sdUUID)
+ with rm.acquireResource(img_ns, imgUUID, rm.EXCLUSIVE):
return image.Image(self.poolPath) \
.download(methodArgs, sdUUID, imgUUID, volUUID)
@@ -1706,10 +1702,8 @@
while not startEvent.is_set():
startEvent.wait()
- imgResourceLock = rm.acquireResource(
- sd.getNamespace(sc.IMAGE_NAMESPACE, sdUUID), imgUUID, rm.SHARED)
-
- with imgResourceLock:
+ img_ns = sd.getNamespace(sc.IMAGE_NAMESPACE, sdUUID)
+ with rm.acquireResource(img_ns, imgUUID, rm.SHARED):
try:
return image.Image(self.poolPath) \
.copyFromImage(methodArgs, sdUUID, imgUUID, volUUID)
@@ -1721,10 +1715,8 @@
"""
Download an image from a stream.
"""
- imgResourceLock = rm.acquireResource(
- sd.getNamespace(sc.IMAGE_NAMESPACE, sdUUID), imgUUID, rm.EXCLUSIVE)
-
- with imgResourceLock:
+ img_ns = sd.getNamespace(sc.IMAGE_NAMESPACE, sdUUID)
+ with rm.acquireResource(img_ns, imgUUID, rm.EXCLUSIVE):
try:
return image.Image(self.poolPath) \
.copyToImage(methodArgs, sdUUID, imgUUID, volUUID)
--
To view, visit https://gerrit.ovirt.org/65042
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8ff5653f0b15861d2034011f7fccc76bf25788f6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
gerrit-hooks has posted comments on this change.
Change subject: tests: Add tests for poll and wait failures
......................................................................
Patch Set 5:
* Update tracker: IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
--
To view, visit https://gerrit.ovirt.org/65294
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I8674c9c3c2118041c74213cd8ce0d383086d6cbf
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
gerrit-hooks has posted comments on this change.
Change subject: tests: Add tests for poll and wait failures
......................................................................
Patch Set 4:
* Update tracker: IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
--
To view, visit https://gerrit.ovirt.org/65294
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I8674c9c3c2118041c74213cd8ce0d383086d6cbf
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
gerrit-hooks has posted comments on this change.
Change subject: tests: Add tests for poll and wait failures
......................................................................
Patch Set 3:
* Update tracker: IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
--
To view, visit https://gerrit.ovirt.org/65294
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I8674c9c3c2118041c74213cd8ce0d383086d6cbf
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
gerrit-hooks has posted comments on this change.
Change subject: hsm:Use sd compat instead of qemu conf compat.
......................................................................
Patch Set 9:
* Update tracker: IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
--
To view, visit https://gerrit.ovirt.org/64951
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie4b19a99e5d9a73c011bf6d8079e3855298561b9
Gerrit-PatchSet: 9
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <mlipchuk(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Amit Aviram <aaviram(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Maor Lipchuk <mlipchuk(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
Adam Litke has uploaded a new change for review.
Change subject: fix abort to raise
......................................................................
fix abort to raise
Change-Id: I5efe2319d023bd813777c76a0bbaa0b9576281f6
Signed-off-by: Adam Litke <alitke(a)redhat.com>
---
M lib/vdsm/jobs.py
M tests/jobsTests.py
2 files changed, 21 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/47/65147/1
diff --git a/lib/vdsm/jobs.py b/lib/vdsm/jobs.py
index 2c6c27c..42f43bc 100644
--- a/lib/vdsm/jobs.py
+++ b/lib/vdsm/jobs.py
@@ -155,13 +155,24 @@
self._status = STATUS.RUNNING
try:
self._run()
+ except exception.ActionStopped:
+ # Once a job has been aborted we expect _run to raise ActionStopped
+ with self._status_lock:
+ if self.status != STATUS.ABORTING:
+ logging.warning("Unexpected ActionStopped exception in "
+ "job %r from state %r",
+ self.id, self.status)
+ self._status = STATUS.ABORTED
+ if self.autodelete:
+ self._autodelete()
except Exception as e:
with self._status_lock:
if self.status == STATUS.ABORTING:
+ # Other exceptions while in aborting state mean that abort
+ # was not successful. We should not autodelete because
+ # there may still be an ongoing operation.
logging.exception("Failed to abort job (id=%s desc=%s)",
self.id, self.description)
- # We do not autodelete failed aborting jobs because it is
- # likely that something is still running on the system.
else:
self._status = STATUS.FAILED
logging.exception("Job (id=%s desc=%s) failed",
@@ -172,13 +183,12 @@
e = exception.GeneralException(str(e))
self._error = e
else:
+ # We always mark the job done. Even if we were in aborting state
+ # _run might finish normally before the abort action executes.
with self._status_lock:
- if self.status == STATUS.ABORTING:
- self._status = STATUS.ABORTED
- else:
- self._status = STATUS.DONE
- if self.autodelete:
- self._autodelete()
+ self._status = STATUS.DONE
+ if self.autodelete:
+ self._autodelete()
def _abort(self):
"""
@@ -188,6 +198,8 @@
status to change to aborted.
- Must raise if the job could not be aborted
- Must not raise if the job was aborted
+ - A successful abort must cause the job's _run method to raise an
+ ActionStopped exception.
"""
raise AbortNotSupported()
diff --git a/tests/jobsTests.py b/tests/jobsTests.py
index 6c6d49a..4c83810 100644
--- a/tests/jobsTests.py
+++ b/tests/jobsTests.py
@@ -86,6 +86,7 @@
def _run(self):
self.event_running.set()
self.event_aborted.wait(1)
+ raise exception.ActionStopped()
def _abort(self):
self.event_aborted.set()
--
To view, visit https://gerrit.ovirt.org/65147
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5efe2319d023bd813777c76a0bbaa0b9576281f6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>