ironic/ironic/tests/unit/conductor
Julia Kreger a54376cef0 Remove locks before RPC bus is started
A partner performing some testing recognized a case where if a request
is sent to the Ironic Conductor while it is in the process of starting,
and the request makes it into be processed, yet latter the operation
fails with errors such as NodeNotLocked exception. Notably they were
able to reproduce this by requesting the attachment or detachment of
a VIF at the same time as restarting the conductor.

In part, this condition is due to to the conductor being restarted
where the conductors table includes the node being restarted and
the webserver has not possibly had a chance to observe that the
conductor is in the process of restarting as the hash ring is
still valid.

In short - Incoming RPC requests can come in during the initialization
window and as such we should not remove locks while the conductor could
possibly already be receiving work.

As such, we've added a ``prepare_host`` method which initializes
the conductor database connection and removes the stale locks.
Under normal operating conditions, the database client is reused.

rhbz# 1847305

Change-Id: I8e759168f1dc81cdcf430f3e33be990731595ec3
(cherry picked from commit b8e4aba1ec)
2020-07-29 17:33:15 +00:00
..
__init__.py Prepare for functional testing 2015-09-28 21:27:01 +00:00
mgr_utils.py Remove locks before RPC bus is started 2020-07-29 17:33:15 +00:00
test_allocations.py Allocation API: backfilling allocations 2019-05-21 20:09:21 +02:00
test_base_manager.py Remove locks before RPC bus is started 2020-07-29 17:33:15 +00:00
test_manager.py Allow deleting nodes with a broken driver 2020-07-16 14:08:43 +00:00
test_notification_utils.py Unit test consistency: DB base and utils prefix 2017-06-20 09:36:21 +01:00
test_rpcapi.py Allocation API: conductor API (without HA and take over) 2019-01-31 13:01:09 +01:00
test_steps.py Deploy Templates: factor out ironic.conductor.steps 2019-03-15 10:10:45 +00:00
test_task_manager.py Fix updating nodes with removed or broken drivers 2019-01-09 12:45:10 +01:00
test_utils.py Block ability update callback_url 2019-12-16 22:17:22 +00:00