Completion cache is not concurrency-safe
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-novaclient |
Fix Released
|
Medium
|
Ryan Wilson |
Bug Description
The completion cache is not thread-safe if a Client is used by multiple threads
There is no locking around updating the cache so multiple threads may open, write to, and close the cache simultaneously. Since the cache file object is stored as an attribute on the Manager, they will use the same file handle if available, possibly resulting in writing to a closed file.
Sample tracebacks:
2013-08-19 14:17:45,887 ERROR nodepool.
Traceback (most recent call last):
File "/usr/local/
self.
File "/usr/local/
flavor = utils.get_
File "/usr/local/
flavors = [f for f in client.
File "/usr/local/
return self._list(
File "/usr/local/
for res in data if res]
File "/usr/local/
self.
File "/usr/local/
cache.
ValueError: I/O operation on closed file
2013-08-19 14:17:45,887 ERROR nodepool.
Traceback (most recent call last):
File "/usr/local/
self.
File "/usr/local/
flavor = utils.get_
File "/usr/local/
flavors = [f for f in client.
File "/usr/local/
return self._list(
File "/usr/local/
for res in data if res]
File "/usr/lib/
self.gen.next()
File "/usr/local/
delattr(self, cache_attr)
AttributeError: _human_id_cache
summary: |
- UUID cache is not concurrency-safe + Completion cache is not concurrency-safe |
description: | updated |
Changed in python-novaclient: | |
importance: | Undecided → Medium |
This is severely affecting the speed to provision multiple vms as we can only use one thread now.