From 93c24b6f3101bdfa9ec79b29effe46d7c7ca0977 Mon Sep 17 00:00:00 2001 From: jiaopengju Date: Thu, 5 Sep 2019 23:04:15 +0800 Subject: [PATCH] Using futurist to solve python3 issues Change-Id: Ibc0beee562905ba93660116799b3f0eb5b7e7b8a --- .../operationengine/engine/executors/thread_pool_executor.py | 4 ++-- lower-constraints.txt | 2 +- requirements.txt | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/karbor/services/operationengine/engine/executors/thread_pool_executor.py b/karbor/services/operationengine/engine/executors/thread_pool_executor.py index 2c3bbc9f..f308bb70 100644 --- a/karbor/services/operationengine/engine/executors/thread_pool_executor.py +++ b/karbor/services/operationengine/engine/executors/thread_pool_executor.py @@ -11,7 +11,7 @@ # under the License. from collections import defaultdict -from concurrent import futures +import futurist from oslo_config import cfg from oslo_log import log as logging from threading import RLock @@ -39,7 +39,7 @@ class ThreadPoolExecutor(base_executor.ScheduledOperationExecutor): if thread_count is None: thread_count = CONF.thread_count - self._pool = futures.ThreadPoolExecutor(thread_count) + self._pool = futurist.GreenThreadPoolExecutor(thread_count) self._operation_to_run = defaultdict(int) self._operation_to_cancel = set() self._lock = RLock() diff --git a/lower-constraints.txt b/lower-constraints.txt index 95b4b722..2df43ff9 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -29,7 +29,7 @@ extras==1.0.0 fasteners==0.14.1 fixtures==3.0.0 flake8==2.5.5 -futurist==1.6.0 +futurist==1.8.0 google-auth==1.4.1 greenlet==0.4.10 hacking==0.12.0 diff --git a/requirements.txt b/requirements.txt index 8553b8bc..50a82f4b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -46,3 +46,4 @@ oslo.i18n>=3.15.3 # Apache-2.0 python-swiftclient>=3.2.0 # Apache-2.0 python-karborclient>=0.6.0 # Apache-2.0 abclient>=0.2.3 # Apache-2.0 +futurist>=1.8.0 # Apache-2.0