From 2b7e6552e82f899a91ce3d6973d90778440fac8c Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Wed, 27 May 2015 14:52:06 -0700 Subject: [PATCH] Remove time formatting in agent clock error This removes time formatting that may be hiding timezone issues that are leading to a delta being calculated between the agent and the server even when it shows none. It also adds logging of the difference so we can see how far off it thinks they are. Example message: during the registration of Open vSwitch agent has a timestamp: 2015-05-19T18:15:27Z. This differs from the current server timestamp: 2015-05-19T18:15:27Z by more than the threshold agent downtime: 75. Note that the timestamps are exactly the same after formatting. Change-Id: Ibfc30444b7a167fb18ae9051a775266236d4ecce Related-Bug: #1456760 --- neutron/db/agents_db.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/neutron/db/agents_db.py b/neutron/db/agents_db.py index 26a6212d5..a9ba6dfe8 100644 --- a/neutron/db/agents_db.py +++ b/neutron/db/agents_db.py @@ -297,16 +297,17 @@ class AgentExtRpcCallback(object): diff = abs((time_server_now - agent_time).seconds) if diff > cfg.CONF.agent_down_time: agent_name = agent_state['agent_type'] - time_agent = timeutils.isotime(agent_time) host = agent_state['host'] log_dict = {'host': host, 'agent_name': agent_name, - 'agent_time': time_agent, + 'agent_time': agent_time, 'threshold': cfg.CONF.agent_down_time, - 'serv_time': timeutils.isotime(time_server_now)} + 'serv_time': time_server_now, + 'diff': diff} LOG.error(_LE("Message received from the host: %(host)s " "during the registration of %(agent_name)s has " "a timestamp: %(agent_time)s. This differs from " "the current server timestamp: %(serv_time)s by " - "more than the threshold agent down" + "%(diff)s seconds, which is more than the " + "threshold agent down" "time: %(threshold)s."), log_dict) -- 2.45.2