diff --git a/openstack/connection.py b/openstack/connection.py index b67cc5905..945283598 100644 --- a/openstack/connection.py +++ b/openstack/connection.py @@ -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 = {} diff --git a/releasenotes/notes/no-start-task-manager-56773f3ea5eb3a59.yaml b/releasenotes/notes/no-start-task-manager-56773f3ea5eb3a59.yaml new file mode 100644 index 000000000..e40507d12 --- /dev/null +++ b/releasenotes/notes/no-start-task-manager-56773f3ea5eb3a59.yaml @@ -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.