Add debug information to AutoScheduler and BaseScheduler
These new debug lines can be helpful to resolve the mentioned bug. Sometimes the DHCP agent does not reschedule and the log does not contain enough information to debug the problem. Spotted error during fullstack tests: Traceback (most recent call last): File "/opt/stack/new/neutron/neutron/tests/base.py", line 151, in func return f(self, *args, **kwargs) File "/opt/stack/new/neutron/neutron/tests/fullstack/test_dhcp_agent.py", line 168, in test_reschedule_network_on_new_agent self._wait_until_network_rescheduled(network_dhcp_agents[0])' File "/opt/stack/new/neutron/neutron/tests/fullstack/test_dhcp_agent.py", line 137, in _wait_until_network_rescheduled common_utils.wait_until_true(_agent_rescheduled) File "/opt/stack/new/neutron/neutron/common/utils.py", line 646, in wait_until_true raise WaitTimeout(_("Timed out after %d seconds") % timeout) neutron.common.utils.WaitTimeout: Timed out after 60 seconds Change-Id: I794e737c30f597519fba873e36f26b82b6f2c799 Related-Bug: #1799555
This commit is contained in:
parent
86139658ef
commit
b3404d900e
@ -17,8 +17,11 @@ import abc
|
||||
from operator import attrgetter
|
||||
import random
|
||||
|
||||
from oslo_log import log as logging
|
||||
import six
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class BaseScheduler(object):
|
||||
@ -48,6 +51,11 @@ class BaseScheduler(object):
|
||||
hosted_agents, num_agents)
|
||||
# bind the resource to the agents
|
||||
self.resource_filter.bind(context, chosen_agents, resource['id'])
|
||||
debug_data = ['(%s, %s, %s)' %
|
||||
(agent['agent_type'], agent['host'], resource['id'])
|
||||
for agent in chosen_agents]
|
||||
LOG.debug('Resources bound (agent type, host, resource id): %s',
|
||||
', '.join(debug_data))
|
||||
return chosen_agents
|
||||
|
||||
|
||||
|
@ -90,8 +90,13 @@ class AutoScheduler(object):
|
||||
bindings_to_add.append((dhcp_agent, net_id))
|
||||
# do it outside transaction so particular scheduling results don't
|
||||
# make other to fail
|
||||
debug_data = []
|
||||
for agent, net_id in bindings_to_add:
|
||||
self.resource_filter.bind(context, [agent], net_id)
|
||||
debug_data.append('(%s, %s, %s)' % (agent['agent_type'],
|
||||
agent['host'], net_id))
|
||||
LOG.debug('Resources bound (agent type, host, resource id): %s',
|
||||
', '.join(debug_data))
|
||||
return True
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user