Change in vdsm[master]: hsm: deleteImage - fix string format
by derez@redhat.com
Daniel Erez has uploaded a new change for review.
Change subject: hsm: deleteImage - fix string format
......................................................................
hsm: deleteImage - fix string format
getExclusiveLock -> namespace should be formatted
as '"%s_%s" % (imgUUID, sdUUID)'.
Change-Id: Ia3b7b491ba2ccb695c6f555d18007a6d50054349
Signed-off-by: Daniel Erez <derez(a)redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/66/29666/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index bac48a8..30767b4 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -1494,7 +1494,7 @@
# Taking an exclusive lock on both imgUUID and sdUUID since
# an image can exist on two SDs concurrently (e.g. during LSM flow);
# hence, we need a unique identifier.
- vars.task.getExclusiveLock(STORAGE, "%s_%s", imgUUID, sdUUID)
+ vars.task.getExclusiveLock(STORAGE, "%s_%s" % (imgUUID, sdUUID))
vars.task.getSharedLock(STORAGE, sdUUID)
allVols = dom.getAllVolumes()
volsByImg = sd.getVolsOfImage(allVols, imgUUID)
--
To view, visit http://gerrit.ovirt.org/29666
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia3b7b491ba2ccb695c6f555d18007a6d50054349
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Daniel Erez <derez(a)redhat.com>
9 years, 11 months
Change in vdsm[master]: vdsm: Shuting down protocol detector fails
by Nir Soffer
Nir Soffer has posted comments on this change.
Change subject: vdsm: Shuting down protocol detector fails
......................................................................
Patch Set 3:
(4 comments)
Nice, but can be much simpler.
http://gerrit.ovirt.org/#/c/29556/3/vdsm/protocoldetector.py
File vdsm/protocoldetector.py:
Line 93: self.log.debug("Acceptor running")
Line 94: self._required_size = max(h.REQUIRED_SIZE for h in self._handlers)
Line 95: self.log.debug("Using required_size=%d", self._required_size)
Line 96: self._next_cleanup = time.time() + self.CLEANUP_INTERVAL
Line 97: keep_running = True
The keep_running changes are not needed.
Line 98: try:
Line 99: while keep_running:
Line 100: try:
Line 101: keep_running = self._process_events()
Line 95: self.log.debug("Using required_size=%d", self._required_size)
Line 96: self._next_cleanup = time.time() + self.CLEANUP_INTERVAL
Line 97: keep_running = True
Line 98: try:
Line 99: while keep_running:
while True:
Line 100: try:
Line 101: keep_running = self._process_events()
Line 102: except Exception:
Line 103: self.log.exception("Unhandled exception")
Line 97: keep_running = True
Line 98: try:
Line 99: while keep_running:
Line 100: try:
Line 101: keep_running = self._process_events()
Handle Stopped exception here:
except Stopped:
return
Line 102: except Exception:
Line 103: self.log.exception("Unhandled exception")
Line 104: finally:
Line 105: self._cleanup()
Line 169: raise
Line 170:
Line 171: def _cleanup_wakeup_pipe(self):
Line 172: try:
Line 173: return os.read(self._read_fd, 128) == '1'
This is not about cleaning up the pipe any more, but about receiving stop request. So:
def check_wakeup_pipe(self):
try:
if os.read(self._read_fd, 1) == '1':
raise Stopped()
except ...
Line 174: except OSError as e:
Line 175: if e.errno not in (errno.EAGAIN, errno.EWOULDBLOCK):
Line 176: raise
Line 177:
--
To view, visit http://gerrit.ovirt.org/29556
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I82119a61835fe335f2aa5da29fb8d3f2b8ae33fc
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
9 years, 11 months
Change in vdsm[master]: jsonrpc: Accept all stomp commands
by Nir Soffer
Nir Soffer has posted comments on this change.
Change subject: jsonrpc: Accept all stomp commands
......................................................................
Patch Set 2: Code-Review+1
(1 comment)
Can be little nicer.
http://gerrit.ovirt.org/#/c/29652/2/lib/yajsonrpc/stompReactor.py
File lib/yajsonrpc/stompReactor.py:
Line 305: def detect(self, data):
Line 306: return data.startswith((Command.CONNECT, Command.CONNECTED,
Line 307: Command.ERROR, Command.MESSAGE,
Line 308: Command.RECEIPT, Command.SEND,
Line 309: Command.SUBSCRIBE, Command.UNSUBSCRIBE))
Nice!
But calculating required size must be synced now with 8 commands.
Would be nicer to do:
class StompDetector:
COMMANDS = (Command.CONNECT, ...)
REQUIRED_SIZE = max(len(s) for s in COMMANDS)
def detect(self, data):
return data.startswith(self.COMMANDS)
Line 310:
Line 311: def handleSocket(self, client_socket, socket_address):
Line 312: self.json_binding.add_socket(self._reactor, client_socket)
--
To view, visit http://gerrit.ovirt.org/29652
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I63029e43bfd5f06bb8f25958b78f75850d45b6df
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
9 years, 11 months
Change in vdsm[ovirt-3.5]: introduce connectivity log
by Dan Kenigsberg
Hello Antoni Segura Puimedon,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/29646
to review the following change.
Change subject: introduce connectivity log
......................................................................
introduce connectivity log
Users have been requesting to have access to a simple log file that
tracks host connectivity. This patch adds /var/log/vdsm/connectivity.log
for that purpose. It adds a line for any change of connectivity of
tracked interfaces.
Note that the connectivity change is not implemented with `ip monitor`,
since the latter seems to ignore link speed changes, which are required
to be logged.
Bug-Url: https://bugzilla.redhat.com/1111234
Change-Id: I86dc41223babe43194add7ce778c6567b2bc5823
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/29472
Reviewed-by: Antoni Segura Puimedon <asegurap(a)redhat.com>
---
M tests/samplingTests.py
M vdsm/logger.conf.in
M vdsm/virt/sampling.py
3 files changed, 65 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/46/29646/1
diff --git a/tests/samplingTests.py b/tests/samplingTests.py
index 9890dd3..2ff703e 100644
--- a/tests/samplingTests.py
+++ b/tests/samplingTests.py
@@ -22,6 +22,7 @@
import tempfile
import shutil
+from vdsm import ipwrapper
import virt.sampling as sampling
from testrunner import VdsmTestCase as TestCaseBase
@@ -101,3 +102,12 @@
with MonkeyPatchScope([(sampling, '_PROC_STAT_PATH',
self._extra_path)]):
self.assertEquals(sampling.getBootTime(), 1395249141)
+
+
+class InterfaceSampleTests(TestCaseBase):
+ def testDiff(self):
+ lo = ipwrapper.getLink('lo')
+ s0 = sampling.InterfaceSample(lo)
+ s1 = sampling.InterfaceSample(lo)
+ s1.operstate = 'x'
+ self.assertEquals('operstate:x', s1.connlog_diff(s0))
diff --git a/vdsm/logger.conf.in b/vdsm/logger.conf.in
index 5b0cf63..87159e4 100644
--- a/vdsm/logger.conf.in
+++ b/vdsm/logger.conf.in
@@ -1,8 +1,8 @@
[loggers]
-keys=root,vds,Storage,ovirt_hosted_engine_ha
+keys=root,vds,Storage,ovirt_hosted_engine_ha,connectivity
[handlers]
-keys=console,syslog,logfile
+keys=console,syslog,logfile,connlogfile
[formatters]
keys=long,simple,none,sysform
@@ -30,6 +30,12 @@
qualname=ovirt_hosted_engine_ha
propagate=1
+[logger_connectivity]
+level=DEBUG
+handlers=connlogfile
+qualname=connectivity
+propagate=0
+
[handler_syslog]
level=WARNING
class=handlers.SysLogHandler
@@ -43,13 +49,20 @@
level=DEBUG
formatter=long
+[handler_connlogfile]
+class=logging.handlers.WatchedFileHandler
+args=('@VDSMLOGDIR(a)/connectivity.log',)
+filters=storage.misc.TracebackRepeatFilter
+level=DEBUG
+formatter=simple
+
[handler_console]
class: StreamHandler
args: []
formatter: none
[formatter_simple]
-format: %(name)s:%(levelname)s: %(message)s
+format: %(asctime)s:%(levelname)s:%(message)s
[formatter_none]
format: %(message)s
@@ -60,8 +73,3 @@
[formatter_sysform]
format= vdsm %(name)s %(levelname)s %(message)s
datefmt=
-
-
-
-
-
diff --git a/vdsm/virt/sampling.py b/vdsm/virt/sampling.py
index e6a5646..f70814b 100644
--- a/vdsm/virt/sampling.py
+++ b/vdsm/virt/sampling.py
@@ -111,6 +111,23 @@
self.operstate = self.readIfaceOperstate(ifid)
self.speed = _getLinkSpeed(link)
+ _LOGGED_ATTRS = ('operstate', 'speed')
+
+ def _log_attrs(self, attrs):
+ return ' '.join(
+ '%s:%s' % (attr, getattr(self, attr)) for attr in attrs)
+
+ def to_connlog(self):
+ return self._log_attrs(self._LOGGED_ATTRS)
+
+ def connlog_diff(self, other):
+ """Return a textual description of the interesting stuff new to self
+ and missing in 'other'."""
+
+ return self._log_attrs(
+ attr for attr in self._LOGGED_ATTRS
+ if getattr(self, attr) != getattr(other, attr))
+
class TotalCpuSample:
"""
@@ -261,6 +278,20 @@
self.thpState = 'never'
self.cpuCores = CpuCoreSample()
self.numaNodeMem = NumaNodeMemorySample()
+
+ def to_connlog(self):
+ return ', '.join(
+ ('%s:(%s)' % (ifid, ifacesample.to_connlog()))
+ for (ifid, ifacesample) in self.interfaces.iteritems())
+
+ def connlog_diff(self, other):
+ text = ''
+ for ifid, sample in self.interfaces.iteritems():
+ if ifid in other.interfaces:
+ text += sample.connlog_diff(other.interfaces[ifid])
+ else:
+ text += 'new (%s) ' % sample.to_connlog()
+ return text
class AdvancedStatsFunction(object):
@@ -431,6 +462,7 @@
"""
AVERAGING_WINDOW = 5
SAMPLE_INTERVAL_SEC = 2
+ _CONNLOG = logging.getLogger('connectivity')
def __init__(self, log):
self.startTime = time.time()
@@ -461,6 +493,13 @@
try:
sample = self.sample()
self._samples.append(sample)
+ if len(self._samples) == 1:
+ self._CONNLOG.debug('%s', sample.to_connlog())
+ else:
+ diff = sample.connlog_diff(self._samples[-2])
+ if diff:
+ self._CONNLOG.debug('%s', diff)
+
self._lastSampleTime = sample.timestamp
if len(self._samples) > self.AVERAGING_WINDOW:
self._samples.pop(0)
--
To view, visit http://gerrit.ovirt.org/29646
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I86dc41223babe43194add7ce778c6567b2bc5823
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
9 years, 11 months
Change in vdsm[master]: vdsm: extend image over jsonrpc
by smizrahi@redhat.com
Saggi Mizrahi has posted comments on this change.
Change subject: vdsm: extend image over jsonrpc
......................................................................
Patch Set 7: Code-Review+2
--
To view, visit http://gerrit.ovirt.org/29359
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I437a23e04f97fb89eb4cd5646b73d9b1bddf240a
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourfali(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
9 years, 11 months