Catch exceptions for interfaceStats in libvirt inspector
In the Libvirt inspector we call the interfaceStats()
function but there is a race between us checking if
the domain is stopped and calling interfaceStats.
This adds a try-catch around interfaceStats the
same way as is already done for blockStats etc.
Closes-Bug: #2113768
Change-Id: I25ba64f5eefe8140b45bc4ff7e20c323dc5efd79
(cherry picked from commit 70a56ba670)
Signed-off-by: Tobias Urdin <tobias.urdin@binero.com>
This commit is contained in:
@@ -114,7 +114,13 @@ class LibvirtInspector(virt_inspector.Inspector):
|
||||
params['interfaceid'] = interfaceid
|
||||
params['bridge'] = bridge
|
||||
|
||||
dom_stats = domain.interfaceStats(name)
|
||||
try:
|
||||
dom_stats = domain.interfaceStats(name)
|
||||
except libvirt.libvirtError as ex:
|
||||
LOG.warning(_("Error from libvirt when running instanceStats, "
|
||||
"This may not be harmful, but please check : "
|
||||
"%(ex)s") % {'ex': ex})
|
||||
continue
|
||||
|
||||
# Retrieve previous values
|
||||
prev = self.cache.get(name)
|
||||
|
||||
6
releasenotes/notes/bug-2113768-a2db3a59c8e13558.yaml
Normal file
6
releasenotes/notes/bug-2113768-a2db3a59c8e13558.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Fixed `bug #2113768 <https://bugs.launchpad.net/ceilometer/+bug/2113768>`__ where
|
||||
the Libvirt inspector did not catch exceptions thrown when calling interfaceStats
|
||||
function on a domain.
|
||||
Reference in New Issue
Block a user