From 09e2d55cc41adf2d14e1ebba338ade2ed27eebce Mon Sep 17 00:00:00 2001 From: Sulochan Acharya Date: Wed, 12 Mar 2025 13:14:22 +0000 Subject: [PATCH] Changes health probe to cleanly close connection Currently, the health-probe.py file opens connection to amqp for rpc test, however, does not cleanly close the client transport connection. This causes ampq like rabbitmq to log warning messages and makes troubleshooting difficult. This patch adds a clean transport.clenup once the rpc test is over. Change-Id: I55824d550344771368f97462836d5386cbf50fcd --- neutron/templates/bin/_health-probe.py.tpl | 4 ++++ nova/templates/bin/_health-probe.py.tpl | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/neutron/templates/bin/_health-probe.py.tpl b/neutron/templates/bin/_health-probe.py.tpl index b5e170bcfd..d910045616 100644 --- a/neutron/templates/bin/_health-probe.py.tpl +++ b/neutron/templates/bin/_health-probe.py.tpl @@ -104,6 +104,10 @@ def check_agent_status(transport): " agent") sys.exit(0) + finally: + if transport: + transport.cleanup() + def sriov_readiness_check(): """Checks the sriov configuration on the sriov nic's""" diff --git a/nova/templates/bin/_health-probe.py.tpl b/nova/templates/bin/_health-probe.py.tpl index 6450301ae3..04e95d01a5 100644 --- a/nova/templates/bin/_health-probe.py.tpl +++ b/nova/templates/bin/_health-probe.py.tpl @@ -103,6 +103,10 @@ def check_service_status(transport): " service") sys.exit(0) + finally: + if transport: + transport.cleanup() + def tcp_socket_status(process, ports): """Check the tcp socket status on a process"""