Don't start task managers passed in to Connection
If someone (such as our friend nodepool) creates and passes in a TaskManager, it should be assumed that the calling context controls the lifecycle of that TaskManager. In that case, don't run start() on it. Depends-On: https://review.openstack.org/612168 Change-Id: I0ac5dc428250158471cb64d5b1601cabbb4deb86
This commit is contained in:
parent
ec90fb6402
commit
448cda91e3
@ -288,9 +288,14 @@ class Connection(six.with_metaclass(_meta.ConnectionMeta,
|
||||
load_envvars=cloud is not None,
|
||||
**kwargs)
|
||||
|
||||
self.task_manager = task_manager or _task_manager.TaskManager(
|
||||
self.config.full_name)
|
||||
self.task_manager.start()
|
||||
if task_manager:
|
||||
# If a TaskManager was passed in, don't start it, assume it's
|
||||
# under the control of the calling context.
|
||||
self.task_manager = task_manager
|
||||
else:
|
||||
self.task_manager = _task_manager.TaskManager(
|
||||
self.config.full_name)
|
||||
self.task_manager.start()
|
||||
|
||||
self._session = None
|
||||
self._proxies = {}
|
||||
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Fixed a regression in the new `TaskManager` code which caused programs that
|
||||
were passing in a `TaskManager` that they had been running `start` on to
|
||||
fail due to a double call.
|
Loading…
Reference in New Issue
Block a user