commit 52679374a404b14578c834f47d6d4d35e85df2e1
Author: Matthew Booth <email address hidden>
Date: Sat Dec 16 20:27:08 2017 +0000
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.
NOTE(mriedem): The conflict in filter_scheduler.py is due to
48268c73e3f43fa763d071422816942942987f4a in Pike which is not
needed here. The conflict in host_manager.py is due to
d1de5385233ce4379b17a7404557c6724dc37cd4 in Pike which is not
needed here.
Change-Id: Ibb7c43a0abc433f93fc3de71146263e6d5923666
Closes-Bug: #1739323
(cherry picked from commit d72b33b986525a9b2c7aa08b609ae386de1d0e89)
(cherry picked from commit b6a1a192955da3d18f50dfa3130c95fc15d7a66a)
Reviewed: https:/ /review. openstack. org/529635 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=52679374a40 4b14578c834f47d 6d4d35e85df2e1
Committed: https:/
Submitter: Zuul
Branch: stable/ocata
commit 52679374a404b14 578c834f47d6d4d 35e85df2e1
Author: Matthew Booth <email address hidden>
Date: Sat Dec 16 20:27:08 2017 +0000
Fix an error in _get_host_states when deleting a compute node
_get_ host_states returns a generator which closes over seen_nodes, which state_map, which is global. It also modifies host_state_ map, and will remove entries whose compute nodes are no
is local, and self.host_
self.
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.
Conflicts:
nova/ scheduler/ filter_ scheduler. py
nova/ scheduler/ host_manager. py
NOTE(mriedem): The conflict in filter_scheduler.py is due to 43fa763d0714228 16942942987f4a in Pike which is not ce4379b17a74045 57c6724dc37cd4 in Pike which is not
48268c73e3f
needed here. The conflict in host_manager.py is due to
d1de5385233
needed here.
Change-Id: Ibb7c43a0abc433 f93fc3de7114626 3e6d5923666 b2c7aa08b609ae3 86de1d0e89) 18f50dfa3130c95 fc15d7a66a)
Closes-Bug: #1739323
(cherry picked from commit d72b33b986525a9
(cherry picked from commit b6a1a192955da3d