Merge "Ignored error state cache for new requests"
This commit is contained in:
commit
f38d010626
|
@ -682,7 +682,13 @@ def start_introspection(uuid, **kwargs):
|
||||||
node_info=node_info)
|
node_info=node_info)
|
||||||
state = istate.States.starting
|
state = istate.States.starting
|
||||||
else:
|
else:
|
||||||
state = node_info.state
|
recorded_state = node_info.state
|
||||||
|
if istate.States.error == recorded_state:
|
||||||
|
# If there was a failure, return to starting state to avoid
|
||||||
|
# letting the cache block new runs from occuring.
|
||||||
|
state = istate.States.starting
|
||||||
|
else:
|
||||||
|
state = recorded_state
|
||||||
return add_node(uuid, state, **kwargs)
|
return add_node(uuid, state, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1305,6 +1305,17 @@ class TestStartIntrospection(test_base.NodeTest):
|
||||||
self.node_info.uuid)
|
self.node_info.uuid)
|
||||||
self.assertFalse(add_node_mock.called)
|
self.assertFalse(add_node_mock.called)
|
||||||
|
|
||||||
|
@prepare_mocks
|
||||||
|
def test_ensure_start_on_error(self, fsm_event_mock,
|
||||||
|
add_node_mock):
|
||||||
|
def side_effect(*args):
|
||||||
|
self.node_info._state = istate.States.error
|
||||||
|
|
||||||
|
fsm_event_mock.side_effect = side_effect
|
||||||
|
node_cache.start_introspection(self.node.uuid)
|
||||||
|
add_node_mock.assert_called_once_with(self.node_info.uuid,
|
||||||
|
istate.States.starting)
|
||||||
|
|
||||||
|
|
||||||
class TestIntrospectionDataDbStore(test_base.NodeTest):
|
class TestIntrospectionDataDbStore(test_base.NodeTest):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Fixes an issue where a failed inspection due to a transient failure can
|
||||||
|
prevent retry attempts to inspect to be perceived as a failure. If a prior
|
||||||
|
inspection fails and is in ``error`` state, when a new introspection is
|
||||||
|
requested, the state is now appropriately set to ``starting``.
|
Loading…
Reference in New Issue