Francesco Romani has uploaded a new change for review.
Change subject: periodic: use name for the work sent to executor
......................................................................
periodic: use name for the work sent to executor
WIP
to improve debuggability
Change-Id: If8d1180b727571cce34e8304ac48390ed2135f79
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M tests/periodicTests.py
M vdsm/virt/periodic.py
2 files changed, 6 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/93/48193/1
diff --git a/tests/periodicTests.py b/tests/periodicTests.py
index 5320223..1fee0b3 100644
--- a/tests/periodicTests.py
+++ b/tests/periodicTests.py
@@ -266,7 +266,7 @@
def __init__(self, fail=False):
self._fail = fail
- def dispatch(self, func, timeout):
+ def dispatch(self, func, timeout, name):
if self._fail:
raise executor.TooManyTasks()
else:
diff --git a/vdsm/virt/periodic.py b/vdsm/virt/periodic.py
index 8e4012a..ead51d8 100644
--- a/vdsm/virt/periodic.py
+++ b/vdsm/virt/periodic.py
@@ -167,6 +167,7 @@
self._lock = threading.Lock()
self._running = False
self._call = None
+ self._name = str(self._func)
def start(self):
with self._lock:
@@ -213,7 +214,7 @@
Send `func' to Executor to be run as soon as possible.
"""
self._call = None
- self._executor.dispatch(self, self._timeout)
+ self._executor.dispatch(self, self._timeout, self._name)
self._step()
@@ -250,6 +251,7 @@
skipped = []
for vm_id, vm_obj in vms.iteritems():
+ name = '%s on %s' % (self._create, vm_id)
try:
if self._busy_doms.get(vm_id, False):
skipped.append(vm_id)
@@ -270,11 +272,10 @@
except Exception:
# we want to make sure to have VM UUID logged
- self._log.exception("while dispatching %s to VM '%s'",
- self._create, vm_id)
+ self._log.exception("while dispatching %s", name)
else:
try:
- self._executor.dispatch(op, self._timeout)
+ self._executor.dispatch(op, self._timeout, name)
except executor.TooManyTasks:
skipped.append(vm_id)
--
To view, visit
https://gerrit.ovirt.org/48193
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If8d1180b727571cce34e8304ac48390ed2135f79
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>