nova/nova/scheduler
Matthew Booth b6a1a19295 Fix an error in _get_host_states when deleting a compute node
_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 d72b33b986)
2017-12-21 10:37:08 -05:00
..
client Log consumer uuid when retrying claims in the scheduler 2017-10-06 03:41:42 +00:00
filters Refined fix for validating image on rebuild 2017-11-27 20:51:11 -05:00
weights Add PCIWeigher 2017-06-08 09:44:46 +01:00
__init__.py Improve hacking rule to avoid author markers 2014-05-05 14:35:20 +02:00
caching_scheduler.py Mark Chance and Caching schedulers as deprecated 2017-08-09 10:53:53 -07:00
chance.py Mark Chance and Caching schedulers as deprecated 2017-08-09 10:53:53 -07:00
driver.py placement: scheduler uses allocation candidates 2017-07-07 11:35:54 -04:00
filter_scheduler.py Fix an error in _get_host_states when deleting a compute node 2017-12-21 10:37:08 -05:00
host_manager.py Fix an error in _get_host_states when deleting a compute node 2017-12-21 10:37:08 -05:00
ironic_host_manager.py Set IronicNodeState.uuid in _update_from_compute_node 2017-07-25 17:52:47 -04:00
manager.py Raise NoValidHost if no allocation candidates 2017-08-08 14:00:08 +02:00
rpcapi.py conf: remove *_topic config opts 2017-07-17 21:27:02 -07:00
utils.py Refined fix for validating image on rebuild 2017-11-27 20:51:11 -05:00