ironic/ironic/tests/unit
Julia Kreger 4795527284 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)
(cherry picked from commit a54376cef0)
(cherry picked from commit 5b7ca45ae5)
2020-08-04 11:42:44 -07:00
..
api Do not ignore 'fields' query parameter when building next url 2019-10-22 09:15:45 -07:00
cmd Allow data migrations to accept options 2018-01-25 16:51:42 +00:00
common Remove locks before RPC bus is started 2020-08-04 11:42:44 -07:00
conductor Remove locks before RPC bus is started 2020-08-04 11:42:44 -07:00
conf Remove deprecated [keystone] config section 2018-06-11 13:30:50 +00:00
db Migration step to update objects to latest version 2018-10-26 13:45:11 +02:00
dhcp Completely stop using the "fake" classic driver in unit tests 2018-06-06 16:10:43 +02:00
drivers Fix issue where server fails to reboot 2020-04-22 13:08:50 +03:00
objects Use max version of an object 2018-08-02 13:43:51 +00:00
__init__.py Setup logging in unit tests 2017-04-13 20:47:10 +03:00
policy_fixture.py Add keystone policy support to Ironic 2016-08-04 12:43:20 +00:00
raid_constants.py Fix for Unable to create RAID1 on Dell BOSS card 2018-06-19 14:41:57 -04:00
stubs.py Handle case when a glance image contains no data 2018-02-07 13:45:55 +01:00
test_base.py Fix issue with double mocking of utils.execute functions 2018-02-23 05:44:59 -08:00