From 7fe370b7290f5ffd929214800ce1c05c672456bb Mon Sep 17 00:00:00 2001 From: whysage <67018871+whysage@users.noreply.github.com> Date: Sat, 25 Sep 2021 14:06:43 +0300 Subject: [PATCH] remote: add support for Amazon S3 timeout configuration (#6634) Fixes #6241 --- dvc/config_schema.py | 2 ++ dvc/fs/s3.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/dvc/config_schema.py b/dvc/config_schema.py index c3aa29d32..13d5a73ae 100644 --- a/dvc/config_schema.py +++ b/dvc/config_schema.py @@ -156,6 +156,8 @@ SCHEMA = { "grant_write_acp": str, "grant_full_control": str, "cache_regions": bool, + "read_timeout": Coerce(int), + "connect_timeout": Coerce(int), **REMOTE_COMMON, }, "gs": { diff --git a/dvc/fs/s3.py b/dvc/fs/s3.py index 91295a791..e22854179 100644 --- a/dvc/fs/s3.py +++ b/dvc/fs/s3.py @@ -99,6 +99,11 @@ class BaseS3FileSystem(ObjectFSWrapper): client["endpoint_url"] = config.get("endpointurl") client["verify"] = config.get("ssl_verify") + # timeout configuration + config_kwargs = login_info["config_kwargs"] + config_kwargs["read_timeout"] = config.get("read_timeout") + config_kwargs["connect_timeout"] = config.get("connect_timeout") + # encryptions additional = login_info["s3_additional_kwargs"] additional["ServerSideEncryption"] = config.get("sse")