From 84999664ef1d814432ac21c9cf644f92b51a1de1 Mon Sep 17 00:00:00 2001 From: OpenStack Release Bot Date: Mon, 16 Sep 2024 12:17:17 +0000 Subject: [PATCH 1/4] Update .gitreview for stable/2024.2 Change-Id: Ibc4f329ab89f48148551b321d00a394168b2dc7d --- .gitreview | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitreview b/.gitreview index 22a55f927c..8035f66a00 100644 --- a/.gitreview +++ b/.gitreview @@ -2,3 +2,4 @@ host=review.opendev.org port=29418 project=openstack/ceilometer.git +defaultbranch=stable/2024.2 From a36cc766ca7366ce09bd41f32c81b9f28c6e3675 Mon Sep 17 00:00:00 2001 From: OpenStack Release Bot Date: Mon, 16 Sep 2024 12:17:18 +0000 Subject: [PATCH 2/4] Update TOX_CONSTRAINTS_FILE for stable/2024.2 Update the URL to the upper-constraints file to point to the redirect rule on releases.openstack.org so that anyone working on this branch will switch to the correct upper-constraints list automatically when the requirements repository branches. Until the requirements repository has as stable/2024.2 branch, tests will continue to use the upper-constraints list on master. Change-Id: I7f45eb71b380710e58c976e7c9f19dd783d38ddd --- tox.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index e0f47ba9bb..31ada6dd89 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ ignore_basepython_conflict=true [testenv] basepython = python3 deps = - -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} + -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2024.2} -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt usedevelop = True @@ -44,7 +44,7 @@ commands = [testenv:releasenotes] deps = - -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} + -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2024.2} -r{toxinidir}/doc/requirements.txt commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html @@ -53,7 +53,7 @@ commands = oslo-config-generator --config-file=etc/ceilometer/ceilometer-config- [testenv:docs] deps = - -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} + -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2024.2} -r{toxinidir}/requirements.txt -r{toxinidir}/doc/requirements.txt commands = sphinx-build --keep-going -b html -j auto doc/source doc/build/html From dc8b698a6dd3f7d8e82d1cc2763566d203b98725 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Mon, 9 Jun 2025 13:47:09 +0200 Subject: [PATCH 3/4] 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 70a56ba670157bf72d1513b8c177c9294071e2eb) Signed-off-by: Tobias Urdin (cherry picked from commit 87baa22317cdc6cb42a5ea4739c7fd0f2f56d503) --- ceilometer/compute/virt/libvirt/inspector.py | 8 +++++++- releasenotes/notes/bug-2113768-a2db3a59c8e13558.yaml | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/bug-2113768-a2db3a59c8e13558.yaml diff --git a/ceilometer/compute/virt/libvirt/inspector.py b/ceilometer/compute/virt/libvirt/inspector.py index 3c5148367c..893f2ee196 100755 --- a/ceilometer/compute/virt/libvirt/inspector.py +++ b/ceilometer/compute/virt/libvirt/inspector.py @@ -114,7 +114,13 @@ def inspect_vnics(self, instance, duration): 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) diff --git a/releasenotes/notes/bug-2113768-a2db3a59c8e13558.yaml b/releasenotes/notes/bug-2113768-a2db3a59c8e13558.yaml new file mode 100644 index 0000000000..6aaa447b8c --- /dev/null +++ b/releasenotes/notes/bug-2113768-a2db3a59c8e13558.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixed `bug #2113768 `__ where + the Libvirt inspector did not catch exceptions thrown when calling interfaceStats + function on a domain. From c99c0c9f6d491b0bf103705221bc6cdafadfb395 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Wed, 20 Aug 2025 11:33:43 +0200 Subject: [PATCH 4/4] Handle EPIPE Broken Pipe from Libvirt RPC If Libvirt (virtqemud when modular or libvirtd when using monolith) is restarted while we are polling the RPC layer can return a EPIPE Broken Pipe (errcode 32) to us. We should retry when we get this as the service might be back again and we just got aborted because it was restarted. Change-Id: If273f6e9c26f992fb31fccf69d869d7494d41e30 Signed-off-by: Tobias Urdin (cherry picked from commit 2a452552b32537ad3f86d03e8a3f8c0d30f30c86) (cherry picked from commit f1d638faa195647f12d0e48baa39182e821838cc) --- ceilometer/compute/virt/libvirt/utils.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ceilometer/compute/virt/libvirt/utils.py b/ceilometer/compute/virt/libvirt/utils.py index dccc7af3d7..14191a80df 100644 --- a/ceilometer/compute/virt/libvirt/utils.py +++ b/ceilometer/compute/virt/libvirt/utils.py @@ -13,6 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. +import errno from oslo_config import cfg from oslo_log import log as logging import tenacity @@ -107,11 +108,17 @@ def refresh_libvirt_connection(conf, klass): def is_disconnection_exception(e): if not libvirt: return False - return (isinstance(e, libvirt.libvirtError) - and e.get_error_code() in (libvirt.VIR_ERR_SYSTEM_ERROR, - libvirt.VIR_ERR_INTERNAL_ERROR) - and e.get_error_domain() in (libvirt.VIR_FROM_REMOTE, - libvirt.VIR_FROM_RPC)) + if not isinstance(e, libvirt.libvirtError): + return False + is_libvirt_error = ( + e.get_error_code() in (libvirt.VIR_ERR_SYSTEM_ERROR, + libvirt.VIR_ERR_INTERNAL_ERROR) + and e.get_error_domain() in (libvirt.VIR_FROM_REMOTE, + libvirt.VIR_FROM_RPC)) + is_system_error = ( + e.get_error_domain() == libvirt.VIR_FROM_RPC + and e.get_error_code() == errno.EPIPE) + return is_libvirt_error or is_system_error retry_on_disconnect = tenacity.retry(