ironic/ironic
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
..
api Block ability update callback_url 2019-12-16 22:17:22 +00:00
cmd Fix :param: in docstring 2019-06-14 14:23:57 +08:00
common Remove locks before RPC bus is started 2020-07-29 17:33:15 +00:00
conductor Remove locks before RPC bus is started 2020-07-29 17:33:15 +00:00
conf New configuration parameter to use ipmitool retries 2020-07-16 13:15:51 -04:00
db Fix the error message when reached max number of traits 2020-07-06 12:37:48 +00:00
dhcp Merge "Enable no IP address to be returned" 2019-08-12 10:57:43 +00:00
drivers Merge "New configuration parameter to use ipmitool retries" into stable/train 2020-07-19 16:41:32 +00:00
hacking Fix regex string in the hacking check 2019-06-06 14:42:58 +08:00
objects Stop using md5 for __repr__ of objects 2020-07-09 16:04:28 +00:00
tests Remove locks before RPC bus is started 2020-07-29 17:33:15 +00:00
__init__.py Move eventlet monkey patch code 2017-03-02 13:48:18 +02:00
version.py Correct version.py and update current version string 2014-03-21 13:50:05 -07:00