From: Kevin Benton Date: Wed, 27 May 2015 21:52:06 +0000 (-0700) Subject: Remove time formatting in agent clock error X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=2b7e6552e82f899a91ce3d6973d90778440fac8c;p=openstack-build%2Fneutron-build.git 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 --- 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)