b6a1a19295
_get_host_states returns a generator which closes over seen_nodes, which
is local, and self.host_state_map, which is global. It also modifies
self.host_state_map, and will remove entries whose compute nodes are no
longer present.
If a compute node is deleted while a filter is still evaluating the
generator returned by _get_host_states, the entry in self.host_state_map
will be deleted if _get_host_states is called again. This will cause a
KeyError when the first generator comes to evaluate the entry for the
deleted compute node.
We fix this by modifying the returned generator expression to check
that a host_state_map entry still exists before returning it. An
existing unit test is modified to exhibit the bug.
Change-Id: Ibb7c43a0abc433f93fc3de71146263e6d5923666
Closes-Bug: #1739323
(cherry picked from commit
|
||
---|---|---|
.. | ||
client | ||
filters | ||
weights | ||
__init__.py | ||
fakes.py | ||
ironic_fakes.py | ||
test_caching_scheduler.py | ||
test_chance_scheduler.py | ||
test_client.py | ||
test_filter_scheduler.py | ||
test_filters.py | ||
test_host_filters.py | ||
test_host_manager.py | ||
test_ironic_host_manager.py | ||
test_rpcapi.py | ||
test_scheduler.py | ||
test_scheduler_utils.py | ||
test_utils.py |