Skip to content

Commit

Permalink
lfs: remove obsolete _LFSFileSystem.get_client() method override
Browse files Browse the repository at this point in the history
  • Loading branch information
sisp authored and pmrowla committed Jan 23, 2024
1 parent cdc6695 commit 9016d86
Showing 1 changed file with 0 additions and 34 deletions.
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 All @@ -30,39 +29,6 @@ class _LFSFileSystem(HTTPFileSystem):
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

0 comments on commit 9016d86

Please sign in to comment.