Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lfs: remove obsolete _LFSFileSystem.get_client() method override #301

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions src/scmrepo/git/lfs/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import aiohttp
from dvc_http import HTTPFileSystem
from dvc_http.retry import ReadOnlyRetryClient
from dvc_objects.executors import batch_coros
from dvc_objects.fs import localfs
from dvc_objects.fs.callbacks import DEFAULT_CALLBACK
Expand Down Expand Up @@ -33,39 +32,6 @@ def __init__(self, *args, **kwargs):
def _prepare_credentials(self, **config):
return {}

async def get_client(self, **kwargs):
from aiohttp_retry import ExponentialRetry
from dvc_http import make_context

kwargs["retry_options"] = ExponentialRetry(
attempts=self.SESSION_RETRIES,
factor=self.SESSION_BACKOFF_FACTOR,
max_timeout=self.REQUEST_TIMEOUT,
exceptions={aiohttp.ClientError},
)

# The default total timeout for an aiohttp request is 300 seconds
# which is too low for DVC's interactions when dealing with large
# data blobs. We remove the total timeout, and only limit the time
# that is spent when connecting to the remote server and waiting
# for new data portions.
connect_timeout = kwargs.pop("connect_timeout")
kwargs["timeout"] = aiohttp.ClientTimeout(
total=None,
connect=connect_timeout,
sock_connect=connect_timeout,
sock_read=kwargs.pop("read_timeout"),
)

kwargs["connector"] = aiohttp.TCPConnector(
# Force cleanup of closed SSL transports.
# See https://github.com/iterative/dvc/issues/7414
enable_cleanup_closed=True,
ssl=make_context(kwargs.pop("ssl_verify", None)),
)

return ReadOnlyRetryClient(**kwargs)


def _authed(f: Callable[..., Awaitable]):
"""Set credentials and retry the given coroutine if needed."""
Expand Down
Loading