Race condition in keystone domain config
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Fix Released
|
Critical
|
Divya K Konoor |
Bug Description
This is a very difficult to reproduce bug but occurs nevertheless and can be observed when we switch the backend drivers.
Steps to reproduce:
1. Switch the backened driver in keystone conf file from one driver to another . Restart keystone
2. Immediately (if you wait for few seconds, this cannot be reproduced) , make calls that in turn access the keystone methods /keystone/
https:/
Invoke two methods that use this decorators and these method invocations must be almost parallel. Both the methods hit the following flow where the race condition occurs:
def domains_
"""Wraps API calls to lazy load domain configs after init.
"""
@functools.
def wrapper(self, *args, **kwargs):
if (not self.domain_
else:
return f(self, *args, **kwargs)
return wrapper
def setup_domain_
# This is called by the api call wrapper
self.driver = standard_driver
.....
When the first call is placed, it sets self.configured to True and then proceeds towards loading the driver that corresponds to the domain-..However, the second request call assumes the the driver load is already complete (purely based on the value set to self.configured - which is True even though driver is not really loaded). It thus ends up using the default driver (ie driver which is not domain specific ) and retrieves the values.
There should be some synchronization logic added inside domains_configured (or one of the internal methods) so that incorrect backend driver is not used by a request.
Changed in keystone: | |
assignee: | nobody → Divya K Konoor (dikonoor) |
tags: | added: rc-potential |
Changed in keystone: | |
importance: | Undecided → Critical |
Changed in keystone: | |
assignee: | Divya K Konoor (dikonoor) → Dolph Mathews (dolph) |
Changed in keystone: | |
assignee: | Dolph Mathews (dolph) → Divya K Konoor (dikonoor) |
Changed in keystone: | |
milestone: | none → mitaka-rc1 |
I presume you are running Keystone under Apache, configured with multi-thread and multi-process? This problem may not be reproducible under devstack with single-thread, multi-process configuration.
WSGIDaemonProcess keystone-admin processes=5 threads=1 user=gyee display- name=%{ GROUP}