From 2147c70745e231b4b1d5af35eb81ff4128b594c7 Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Thu, 24 Jan 2019 16:23:29 -0500 Subject: [PATCH] Change SR-IOV agent to log message after failure If the SR-IOV agent fails to send its report_state to the server, it logs an exception: Failed reporting state!: MessagingTimeout: Timed out... If it then tries a second time and succeeds it just goes on happily. It would be nice if it logged that it had success on the subsequent attempt so someone looking at the logs know it recovered. Change-Id: I0782599a4f0ffe48c2dd4fa2abc9fe5111715c0c --- .../plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py b/neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py index 6aa37194070..98b84511973 100644 --- a/neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py +++ b/neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py @@ -159,6 +159,7 @@ class SriovNicSwitchAgent(object): LOG.info("RPC agent_id: %s", self.agent_id) self.topic = topics.AGENT + self.failed_report_state = False self.state_rpc = agent_rpc.PluginReportStateAPI(topics.REPORTS) # RPC network init # Handle updates from service @@ -188,7 +189,12 @@ class SriovNicSwitchAgent(object): self.agent_state.pop('resource_versions', None) self.agent_state.pop('start_flag', None) except Exception: + self.failed_report_state = True LOG.exception("Failed reporting state!") + return + if self.failed_report_state: + self.failed_report_state = False + LOG.info("Successfully reported state after a previous failure.") def _create_agent_extension_manager(self, connection): ext_manager.register_opts(self.conf)