ironic/ironic/common
Julia Kreger 062872bce0 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:06 +00:00
..
glance_service Fix the remaining hacking issues 2020-03-31 13:40:00 +00:00
json_rpc Mask secrets when logging in json_rpc 2019-10-21 15:49:30 +02:00
__init__.py Remove copyright from empty files 2014-01-07 21:05:01 +08:00
boot_devices.py Add `FLOPPY` boot device constant 2019-09-13 13:40:02 +02:00
boot_modes.py Adds boot mode support to ManagementInterface 2018-06-15 15:19:41 +00:00
cinder.py Add check on get_endpoint returning None 2019-06-19 16:23:07 +02:00
components.py Add indicator management harness to ManagementInterface 2019-08-26 12:05:29 +02:00
config.py Finalize removal of ipxe_enabled option 2020-02-21 14:25:01 +08:00
context.py Fix tenant DeprecationWarning from oslo_context 2018-05-11 14:28:42 -07:00
dhcp_factory.py Change pxe dhcp options name to codes. 2017-10-13 12:50:58 +03:00
driver_factory.py Add my new address to .mailmap 2020-04-13 07:29:37 -07:00
exception.py Add my new address to .mailmap 2020-04-13 07:29:37 -07:00
faults.py Validating fault value when querying with fault field 2018-06-12 20:47:30 +08:00
fsm.py Stop using six library 2019-12-23 09:38:25 +01:00
grub_conf.template Fix for automated boot iso issue with IPA ramdisk 2015-04-10 09:09:53 -07:00
hash_ring.py Fixes a race condition in the hash ring code 2018-10-05 07:36:30 -04:00
i18n.py Make oslo.i18n an optional dependency 2020-04-02 14:10:21 +02:00
image_service.py Refactor glance retry code to use retrying lib 2020-01-06 14:18:19 +08:00
images.py Support burning configdrive into boot ISO 2020-04-08 20:35:10 +02:00
indicator_states.py Add indicator management harness to ManagementInterface 2019-08-26 12:05:29 +02:00
isolinux_config.template Add support for creating vfat and iso images 2014-08-26 21:18:11 +05:30
keystone.py Stop using six library 2019-12-23 09:38:25 +01:00
network.py Update wording used in removal of VIFs 2018-04-18 03:00:15 +00:00
neutron.py Drop netaddr - use netutils.is_valid_ipv6() 2020-04-07 15:44:17 +02:00
nova.py Update nova os-server-external-events response logic 2019-12-10 09:28:23 -06:00
policy.py Add my new address to .mailmap 2020-04-13 07:29:37 -07:00
profiler.py Enable OSProfiler support in Ironic - follow-up 2017-08-18 14:41:44 +00:00
pxe_utils.py Fix pep8 2020-05-13 11:40:16 +02:00
raid.py Software RAID: don't try to set local_gb to MAX 2020-07-06 13:43:53 +00:00
release_mappings.py Add ironic 15.0 release mapping 2020-04-20 09:43:46 -07:00
rpc.py Make versioned notifications topics configurable 2019-01-23 08:38:18 +01:00
rpc_service.py Remove locks before RPC bus is started 2020-07-29 17:33:06 +00:00
service.py reloads mutable config values on SIGHUP 2018-02-28 23:46:30 +00:00
states.py Clean up nodes in DELETING on conductor restart 2020-07-06 12:35:50 +00:00
swift.py Stop using six library 2019-12-23 09:38:25 +01:00
utils.py Do not autoescape all Jinja2 templates 2020-04-02 11:36:48 +03:00
wsgi_service.py Fix W504 errors 2018-05-09 06:11:30 -07:00