summaryrefslogtreecommitdiff
path: root/nova/rpc.py
diff options
context:
space:
mode:
authormelanie witt <melwittt@gmail.com>2016-09-26 20:08:33 +0000
committermelanie witt <melwittt@gmail.com>2016-09-26 20:49:22 +0000
commitd218f0df65729e2818a63a22f9eb476d376e168e (patch)
tree7551dfc84061e415b8b022e729ffa7edf21ae659 /nova/rpc.py
parent9adb28bfc5d61d3269bb0b266dafac7ae9628f08 (diff)
downloadnova-d218f0df65729e2818a63a22f9eb476d376e168e.tar.gz
Stop overwriting thread local context in ClientRouter
In commit 4df0869, a ClientRouter was added to cache client connections to cell message queues. The periodic task for removing stale clients is called with an empty RequestContext, but this overwrites the copy in thread local storage unless overwrite=False is specified. This adds overwrite=False to the empty RequestContext to prevent it from overwriting the thread local context. All of the other periodic tasks use get_admin_context() which also creates a RequestContext with overwrite=False. Closes-Bug: #1627838 Change-Id: I48024952865fe017e0cb786567b5b445b05e7659
Diffstat (limited to 'nova/rpc.py')
-rw-r--r--nova/rpc.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/nova/rpc.py b/nova/rpc.py
index 1320e50cde..72be15772b 100644
--- a/nova/rpc.py
+++ b/nova/rpc.py
@@ -380,7 +380,8 @@ class ClientRouter(periodic_task.PeriodicTasks):
# NOTE(melwitt): Cells v1 does its own serialization and won't
# have a serializer available on the client object.
self.serializer = getattr(default_client, 'serializer', None)
- self.run_periodic_tasks(nova.context.RequestContext())
+ # Prevent this empty context from overwriting the thread local copy
+ self.run_periodic_tasks(nova.context.RequestContext(overwrite=False))
def _client(self, context, cell_mapping=None):
if cell_mapping: