ironic/ironic
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 Migration step to update objects to latest version 2018-10-26 13:45:11 +02: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 Allow disabling TFTP image cache 2019-01-10 13:49:39 +00:00
db Migration step to update objects to latest version 2018-10-26 13:45:11 +02:00
dhcp Merge "Add meaningful exception in Neutron port show" 2018-03-16 13:49:39 +00:00
drivers Merge "Fix issue where server fails to reboot" into stable/rocky 2020-04-27 11:00:02 +00:00
hacking Follow-up to improve pep8 checking with hacking 2018-07-26 10:29:41 +07:00
objects Use max version of an object 2018-08-02 13:43:51 +00:00
tests Remove locks before RPC bus is started 2020-08-04 11:42:44 -07: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