Merge "Ignored error state cache for new requests"

This commit is contained in:
Zuul 2021-07-02 17:18:21 +00:00 committed by Gerrit Code Review
commit f38d010626
3 changed files with 25 additions and 1 deletions

View File

@ -682,7 +682,13 @@ def start_introspection(uuid, **kwargs):
node_info=node_info)
state = istate.States.starting
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)

View File

@ -1305,6 +1305,17 @@ class TestStartIntrospection(test_base.NodeTest):
self.node_info.uuid)
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):
def setUp(self):

View File

@ -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``.