Make POST /v1/introspection synchronous when manage_boot==False

Without manage_boot the only real action we do is updating the firewall,
which is supposed to be pretty fast. Making the call synchronous means
that ironic will receive information about PXE filter failures and will
not attempt to power on a failed node or before the PXE filter is updated.

Change-Id: I95b63d4e1d4c2c186c0e8234c4382b00aa918aa8
Story: #2007658
Task: #39746
This commit is contained in:
Dmitry Tantsur 2020-05-12 12:21:20 +02:00
parent 3d1bf55b35
commit f3e27c1916
2 changed files with 11 additions and 2 deletions

View File

@ -62,7 +62,10 @@ def introspect(node_id, manage_boot=True, token=None):
manage_boot=manage_boot,
ironic=ironic)
utils.executor().submit(_background_introspect, node_info, ironic)
if manage_boot:
utils.executor().submit(_do_introspect, node_info, ironic)
else:
_do_introspect(node_info, ironic)
def _persistent_ramdisk_boot(node):
@ -92,7 +95,7 @@ def _wait_for_turn(node_info):
@node_cache.release_lock
@node_cache.fsm_transition(istate.Events.wait)
def _background_introspect(node_info, ironic):
def _do_introspect(node_info, ironic):
node_info.acquire_lock()
# TODO(dtantsur): pagination

View File

@ -0,0 +1,6 @@
---
fixes:
- |
The introspection start API is now synchronous when ``manage_boot==False``.
This means that any failures will be propagated to ironic, preventing it
from powering a node on and booting it without the PXE filter updated.