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,7 +288,12 @@ class Connection(six.with_metaclass(_meta.ConnectionMeta,
|
|||||||
load_envvars=cloud is not None,
|
load_envvars=cloud is not None,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
self.task_manager = task_manager or _task_manager.TaskManager(
|
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.config.full_name)
|
||||||
self.task_manager.start()
|
self.task_manager.start()
|
||||||
|
|
||||||
|
@ -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