From 7b4e8bc6026d7bf5bd976542e56c2bc8a1de43b8 Mon Sep 17 00:00:00 2001 From: OpenStack Release Bot Date: Fri, 15 Mar 2024 14:29:12 +0000 Subject: [PATCH 1/4] Update .gitreview for stable/2024.1 Change-Id: Ic467bc1ac25e4897c11c81fcd0ffc2a1e84d2038 --- .gitreview | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitreview b/.gitreview index 22a55f927c..cea15349eb 100644 --- a/.gitreview +++ b/.gitreview @@ -2,3 +2,4 @@ host=review.opendev.org port=29418 project=openstack/ceilometer.git +defaultbranch=stable/2024.1 From bea425e9453f286f011c5c6cd631ac3cf17f722a Mon Sep 17 00:00:00 2001 From: OpenStack Release Bot Date: Fri, 15 Mar 2024 14:29:13 +0000 Subject: [PATCH 2/4] Update TOX_CONSTRAINTS_FILE for stable/2024.1 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.1 branch, tests will continue to use the upper-constraints list on master. Change-Id: Ic7ef721d10e68832986fa2b4365f4daad7a3ea53 --- tox.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 12137fc3b8..7f688b752e 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.1} -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt usedevelop = True @@ -43,7 +43,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.1} -r{toxinidir}/doc/requirements.txt commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html @@ -52,7 +52,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.1} -r{toxinidir}/requirements.txt -r{toxinidir}/doc/requirements.txt commands = sphinx-build --keep-going -b html -j auto doc/source doc/build/html From 3267979e9e9d46e9c46ae5703a3fb48929c0a9ec 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) (cherry picked from commit dc8b698a6dd3f7d8e82d1cc2763566d203b98725) --- 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 be268457e8aff4580e6cbb9f6158830d0f6a9294 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) (cherry picked from commit c99c0c9f6d491b0bf103705221bc6cdafadfb395) --- 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 e30b440f9b..7eae7ed44c 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 @@ -105,11 +106,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(