Change OVS agent to log message after failure

If the OVS 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: I7a54c77073cf2a648d32320b3dd8cb46d34f7c34
This commit is contained in:
Brian Haley 2019-01-24 16:22:02 -05:00 committed by Brian Haley
parent 2f3cc51784
commit 9926410886
1 changed files with 6 additions and 0 deletions

View File

@ -272,6 +272,7 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin,
self.prevent_arp_spoofing = (
not self.sg_agent.firewall.provides_arp_spoofing_protection)
self.failed_report_state = False
# TODO(mangelajo): optimize resource_versions to only report
# versions about resources which are common,
# or which are used by specific extensions.
@ -350,7 +351,12 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin,
# is complete.
systemd.notify_once()
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 _restore_local_vlan_map(self):
self._local_vlan_hints = {}