From ddffffa51cbea928af6cb383871152a2bd6e835a Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Thu, 30 Dec 2021 12:22:11 +0200 Subject: [PATCH] Control S3/GS _stream_download_pool_connections from clearml.conf "stream_connections", default 128 --- clearml/storage/helper.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/clearml/storage/helper.py b/clearml/storage/helper.py index b56d993b..885b2e0b 100644 --- a/clearml/storage/helper.py +++ b/clearml/storage/helper.py @@ -1241,7 +1241,7 @@ class _Boto3Driver(_Driver): _connect_timeout = deferred_config('aws.boto3.connect_timeout', 60) _read_timeout = deferred_config('aws.boto3.read_timeout', 60) - _stream_download_pool_connections = 128 + _stream_download_pool_connections = deferred_config('aws.boto3.stream_connections', 128) _stream_download_pool = None _stream_download_pool_pid = None @@ -1307,7 +1307,7 @@ class _Boto3Driver(_Driver): def _get_stream_download_pool(self): if self._stream_download_pool is None or self._stream_download_pool_pid != os.getpid(): self._stream_download_pool_pid = os.getpid() - self._stream_download_pool = ThreadPoolExecutor(max_workers=self._stream_download_pool_connections) + self._stream_download_pool = ThreadPoolExecutor(max_workers=int(self._stream_download_pool_connections)) return self._stream_download_pool def get_container(self, container_name, config=None, **kwargs): @@ -1510,7 +1510,7 @@ class _Boto3Driver(_Driver): class _GoogleCloudStorageDriver(_Driver): """Storage driver for google cloud storage""" - _stream_download_pool_connections = 128 + _stream_download_pool_connections = deferred_config('google.storage.stream_connections', 128) _stream_download_pool = None _stream_download_pool_pid = None @@ -1550,7 +1550,7 @@ class _GoogleCloudStorageDriver(_Driver): def _get_stream_download_pool(self): if self._stream_download_pool is None or self._stream_download_pool_pid != os.getpid(): self._stream_download_pool_pid = os.getpid() - self._stream_download_pool = ThreadPoolExecutor(max_workers=self._stream_download_pool_connections) + self._stream_download_pool = ThreadPoolExecutor(max_workers=int(self._stream_download_pool_connections)) return self._stream_download_pool def get_container(self, container_name, config=None, **kwargs):