restic/changelog/unreleased
Sébastien Gross f7587be28f mount: detect mountpoint does not exist before opening the repository
Bug #1681 suggests that restic should not be nice to user and should
refrain from creating a mountpoint if it does not exist. Nevertheless,
it currently opens the repository before checking for the mountpoint's
existence. In the case of large or remote repositories, this process
can be time-consuming, delaying the inevitable outcome.

    /restic mount --repo=REMOTE --verbose /tmp/backup
    repository 33f14e42 opened (version 2, compression level max)
    [0:38] 100.00%  162 / 162 index files loaded
    Mountpoint /tmp/backup doesn't exist
    stat /tmp/backup: no such file or directory

    real	0m39.534s
    user	1m53.961s
    sys	0m3.044s

In this scenario, 40 seconds could have been saved if the nonexistence
of the path had been verified beforehand.

This patch relocates the mountpoint check to the beginning of the
runMount function, preceding the opening of the repository.

    /restic mount --repo=REMOTE --verbose /tmp/backup
    Mountpoint /tmp/backup doesn't exist
    stat /tmp/backup: no such file or directory

    real	0m0.136s
    user	0m0.018s
    sys	0m0.027s

Signed-off-by: Sébastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org>
2023-12-24 11:54:18 +01:00
..
.gitignore Add gitignore to changelog/unreleased 2020-11-05 09:01:32 +01:00
issue-4251 extend changelog for --stdin-from-command 2023-10-27 23:58:52 +02:00
issue-4515 retry: Do not retry Load() if file does not exist 2023-10-22 13:25:32 -05:00
issue-4540 Only support ARMv6 on ARM platforms 2023-10-27 19:12:12 +02:00
issue-4547 Split go_target into go_os and go_arch 2023-11-01 22:43:38 +01:00
pull-4503 stats: fix hardlink tracking in a snapshot 2023-10-27 23:40:42 +02:00
pull-4590 mount: detect mountpoint does not exist before opening the repository 2023-12-24 11:54:18 +01:00