From eb5a0a92cea7a404e9b3a78d16a053ff86e26a87 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Tue, 19 Nov 2019 13:57:23 +0000 Subject: [PATCH] fix gs chunks Fixes https://github.com/iterative/dvc/pull/2809#discussion_r347835334 --- dvc/remote/gs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dvc/remote/gs.py b/dvc/remote/gs.py index 3091c628dc..b27a837409 100644 --- a/dvc/remote/gs.py +++ b/dvc/remote/gs.py @@ -17,13 +17,13 @@ from dvc.utils.compat import FileNotFoundError # skipcq: PYL-W0622 logger = logging.getLogger(__name__) +MIN_CHUNKSIZE = 256 * 1024 def dynamic_chunk_size(func): @wraps(func) def wrapper(*args, **kwargs): import requests - from google.cloud.storage.blob import _DEFAULT_CHUNKSIZE # `ConnectionError` may be due to too large `chunk_size` # (see [#2572]) so try halving on error. @@ -37,7 +37,7 @@ def wrapper(*args, **kwargs): while True: try: # skipcq: PYL-W0212 - chunk_size = _DEFAULT_CHUNKSIZE * multiplier + chunk_size = MIN_CHUNKSIZE * multiplier return func(*args, chunk_size=chunk_size, **kwargs) except requests.exceptions.ConnectionError: multiplier //= 2