2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-22 19:08:55 +00:00
restic/internal/backend/sftp
Michael Eischer 8e1e3844aa backend: factor out connection limiting and parameter validation
The SemaphoreBackend now uniformly enforces the limit of concurrent
backend operations. In addition, it unifies the parameter validation.

The List() methods no longer uses a semaphore. Restic already never runs
multiple list operations in parallel.

By managing the semaphore in a wrapper backend, the sections that hold a
semaphore token grow slightly. However, the main bottleneck is IO, so
this shouldn't make much of a difference.

The key insight that enables the SemaphoreBackend is that all of the
complex semaphore handling in `openReader()` still happens within the
original call to `Load()`. Thus, getting and releasing the semaphore
tokens can be refactored to happen directly in `Load()`. This eliminates
the need for wrapping the reader in `openReader()` to release the token.
2023-04-14 22:32:15 +02:00
..
config_test.go sftp: Limit concurrent backend operations 2022-04-09 12:21:38 +02:00
config.go backend: Don't Wrap errors from url.Parse 2022-12-17 09:41:07 +01:00
doc.go Moves files 2017-07-23 14:19:13 +02:00
layout_test.go test: Use testing.T.Cleanup to remove tempdirs 2022-12-09 14:23:55 +01:00
sftp_test.go Replace most usages of ioutil with the underlying function 2022-12-02 19:36:43 +01:00
sftp.go backend: factor out connection limiting and parameter validation 2023-04-14 22:32:15 +02:00
sshcmd_test.go Revert "Put host last in SSH command line" 2020-03-08 16:45:33 +01:00