summaryrefslogtreecommitdiff
path: root/doc/bugs/add_-J_fails_with_not_found/comment_1_daf1f53ac77f664ca0ce572c1bdc45ee._comment
blob: 078d14b6a8d503b40d8aa685f63d6aef382d0079 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
[[!comment format=mdwn
 username="joey"
 subject="""comment 1"""
 date="2017-10-16T16:08:18Z"
 content="""
The "<file> not found" error message comes from
CmdLine.Seek.checkFileOrDirectoryExists, which is intended to catch
git-annex being run with a parameter that does not exist on disk and let
the user know about their mistake.

Seems like that that's being called from withFilesOldUnlocked,
or withFilesMaybeModified. Both of which Command.Add
calls after withFilesNotInGit.

With -J, I suppose there could be worker threads still running
to ingest withFilesNotInGit when it moves on to
withFilesOldUnlocked.

There is a window during file ingestion where the file has been 
removed from the working tree and the annex symlink has not been
created yet. Probably that is triggering checkFileOrDirectoryExists.
Although I'd expect that window to be small, so it's somewhat surprising
that yoh could reproduce this problem multiple times.

The problem could be fixed in several different ways. Could wait for
worker threads to finish before moving on to the next `with*` seek.
Could make checkFileOrDirectoryExists only be run once, rather than 3
times in `git annex add` (which is surely unncessary work..). Or could
try to eliminate the window where the file is not present in the working
tree. It may be worth doing several of those.
"""]]