testremote: Fix crash when testing a freshly made external special remote.

Ignore exceptions when getting the cost and availability for the remote,
and return sane defaults. These defaults are not cached, so if a special
remote program has a transient problem, it will re-query it later.
This commit is contained in:
Joey Hess 2016-07-05 16:34:39 -04:00
parent abe56d4dff
commit d6483deeb1
Failed to extract signature
4 changed files with 31 additions and 4 deletions

View file

@ -1,3 +1,5 @@
[[!metatitle="testremote of external special remote fails with 'Cannot run git-annex-remote-!dne!'"]]
### Please describe the problem.
When git-annex has not recently used a remote, there appears to be a race condition where sometimes it will fail with "git-annex: Cannot run git-annex-remote-!dne! -- Make sure it's in your PATH and is executable."
@ -17,3 +19,4 @@ Output: https://gitlab.com/DanielDent/git-annex-remote-rclone/builds/2166902
The 'git-annex copy test --to GA-rclone-CI' line prior to the 'testremote' invocation seems to warm caches and avoids having the bug trigger.
> [[fixed|done]] --[[Joey]]

View file

@ -0,0 +1,20 @@
[[!comment format=mdwn
username="joey"
subject="""comment 1"""
date="2016-07-05T19:58:41Z"
content="""
AFAICS this can only affect `git annex testremote` and not other commands;
to test behavior when the remote is not accessible, it uses
mkUnavailable which substitutes "!dne!" for various values.
In the case of an external special remote, this causes it to run
git-annex-remote-!dne! which is intentially not in the PATH. So,
testremote is testing the behavior when the external special remote
program is missing.
The bug is that in the remote warmup process it tries to run
git-annex-remote-!dne! in order to query it for GETCOST, and this fails.
It's not a race condition; it just fails the first time, and works
the second time (since it has gotten the cost cached then).
"""]]