diff options
author | Fabian Wiesel <fabian.wiesel@sap.com> | 2022-02-02 10:13:06 +0100 |
---|---|---|
committer | Rajesh Tailor <ratailor@redhat.com> | 2022-08-04 17:36:23 +0530 |
commit | 646fc51732b60b46385ceff0c7ea2c23372bbd72 (patch) | |
tree | d0c99433be8595e591b9ba4f88714615ad4748bd /nova/compute | |
parent | 3b4378c1890337a096b26f1a5335620d475cb778 (diff) | |
download | nova-646fc51732b60b46385ceff0c7ea2c23372bbd72.tar.gz |
Transport context to all threads
The nova.utils.spawn and spawn_n methods transport
the context (and profiling information) to the
newly created threads. But the same isn't done
when submitting work to thread-pools in the
ComputeManager.
The code doing that for spawn and spawn_n
is extracted to a new function
and called to submit the work to the thread-pools.
Closes-Bug: #1962574
Change-Id: I9085deaa8cf0b167d87db68e4afc4a463c00569c
Diffstat (limited to 'nova/compute')
-rw-r--r-- | nova/compute/manager.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 9f8479a30e..de52973b0b 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -8621,7 +8621,8 @@ class ComputeManager(manager.Manager): # in order to be able to track and abort it in the future. self._waiting_live_migrations[instance.uuid] = (None, None) try: - future = self._live_migration_executor.submit( + future = nova.utils.pass_context( + self._live_migration_executor.submit, self._do_live_migration, context, dest, instance, block_migration, migration, migrate_data) self._waiting_live_migrations[instance.uuid] = (migration, future) @@ -9866,7 +9867,9 @@ class ComputeManager(manager.Manager): else: LOG.debug('Triggering sync for uuid %s', uuid) self._syncs_in_progress[uuid] = True - self._sync_power_pool.spawn_n(_sync, db_instance) + nova.utils.pass_context(self._sync_power_pool.spawn_n, + _sync, + db_instance) def _query_driver_power_state_and_sync(self, context, db_instance): if db_instance.task_state is not None: |