ironic/ironic/conf
Dmitry Tantsur d8e09aec55 Fixes a race condition in the hash ring code
The current hash ring code suffers from several problems:

1. The cache is reset on any get_topic_for call, which means that the
   cache is not used between API calls. Previously it was done to work
   around the situation when a new conductor is not visible until the API
   process restarts. Currently we refresh the hash rings periodically.

   This patch removes resetting the cache. To avoid waiting 2 minutes to
   be able to use a new driver:
   1) the hash ring cache is always rebuilt when a ring is not found,
   2) the hash_ring_reset_interval option was changed to 15 seconds.

2. The reset of the cache races with the hot path in the get_ring call.
   It is possible that the reset happens after the class-level cache
   variable is checked but before it is used, yielding None.

   This patch stores the value of the class-level variable to a local
   variable before checking, thus ensuring None is never returned.

Finally, some logging was added to the modified code to make this kind
of problems more debugable in the future.

Conflicts:
	ironic/common/hash_ring.py
	ironic/conductor/rpcapi.py
	ironic/tests/unit/common/test_hash_ring.py

Change-Id: I6e18c6ec23a053b59c76fcadd52b13d84d81b4fb
Story: #2003966
Task: #26896
Partial-Bug: #1792872
(cherry picked from commit 5471157e4f)
2018-10-08 15:54:42 +02:00
..
__init__.py Add XClarity Driver 2018-01-22 08:39:09 -05:00
agent.py Merge "Collect deployment logs from IPA" 2016-08-06 00:33:12 +00:00
ansible.py [ansible] add defaults to config 2017-12-20 10:06:11 +00:00
api.py Promote agent vendor passthru to core API 2016-08-05 12:31:32 +02:00
audit.py Fix default value of "ignore_req_list" config option 2016-12-09 16:14:21 +02:00
auth.py Finalize migration to keystoneauth adapters 2017-12-19 12:17:35 +02:00
cinder.py Use adapters for cinderclient 2017-11-21 09:32:21 +02:00
cisco.py Centralize Config Options - patch merge, cleanup 2016-08-25 11:08:00 -07:00
conductor.py Update description for config params of 'rescue' interface 2018-01-27 09:20:04 +00:00
console.py Make IP address of socat console configurable 2017-07-07 13:14:03 +08:00
database.py Remove overwriting the default value of db_max_retries. 2017-03-10 10:41:27 -08:00
default.py Fixes a race condition in the hash ring code 2018-10-08 15:54:42 +02:00
deploy.py Config drive support for ceph radosgw 2017-04-12 17:21:50 +00:00
dhcp.py Centralize config options - [dhcp] 2016-06-16 17:11:14 -07:00
drac.py DRAC RAID configuration 2016-08-30 10:23:03 +02:00
glance.py Auto-detect the defaults for [glance]swift_{account,temp_url_key,endpoint_url} 2017-12-12 11:48:06 +01:00
ilo.py Remove deprecated [ilo]/clean_priority_erase_devices config 2017-03-30 01:59:24 -04:00
inspector.py Use adapters for inspectorclient 2017-11-21 09:33:08 +02:00
ipmi.py Update comments related to ipmi & old BMCs 2017-07-13 10:37:27 -04:00
irmc.py Add additional capabilities discovery for iRMC driver 2017-11-21 17:49:42 +07:00
iscsi.py Centralize config options - [iscsi] 2016-08-12 06:56:25 -07:00
keystone.py Finalize migration to keystoneauth adapters 2017-12-19 12:17:35 +02:00
metrics.py Pass agent metrics config via conductor 2016-08-02 17:56:43 +00:00
metrics_statsd.py Pass agent metrics config via conductor 2016-08-02 17:56:43 +00:00
neutron.py Update description for config params of 'rescue' interface 2018-01-27 09:20:04 +00:00
oneview.py Remove python-oneviewclient from oneview hardware type. 2018-01-25 01:30:27 +00:00
opts.py Add XClarity Driver 2018-01-22 08:39:09 -05:00
pxe.py Agent rescue implementation 2018-01-25 13:26:33 -05:00
redfish.py Add redfish driver 2017-04-21 11:06:24 +01:00
service_catalog.py Introduce keystoneauth adapters for clients 2017-08-22 06:07:19 +00:00
snmp.py Make SNMP UDP transport settings configurable 2017-08-18 14:42:21 +00:00
swift.py Fix swiftclient creation 2017-12-06 14:14:29 +00:00
xclarity.py Mark xclarity password as secret 2018-05-17 13:22:40 +03:00