-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dvcs-autosync incorrectly records changes on a file 4913
#5
Comments
Hmm it seems that vim is to blame. https://wiki.hpcc.msu.edu/display/Issues/4913+files+created+by+vim+and+home+directory+file+locking+issue I wonder what the right approach here should be:
|
(Hopefully) fixed with 82b4cc8. |
I can confirm your patch goes in the branch and returns from the process_IN_CREATE() function, when event.pathname no longer exists. however, this does not cause aborting the "git add" command. dvcs-autosync starts the "git add" which fails. Furthermore, there are also race conditions.
then you can some 'NEEDEDSLEEP' entries in the log. This means that with the unmodified code, it notices the file exists, queues the cmd_add action, but the file gets removed shortly after. (To clarify: it happens that the cmd_add is scheduled and a "git add" gets executed after either of the os.path.exists branches executed successfully, i.e. no matter if it was the first (normal) one or the second one that demos the race condition) |
Thinking a bit about this further, I would say the actual "check if file still exists" check should not happen at this point, but rather at the point where the actual |
hmm |
Still an issue, and ignore-errors doesn't help because at the time of the add the file just does not exist. The error is pathspec '4913' did not match any files, which I think cannot be ignored by git EDIT: actually something surprising is that the name '4913' in .gitignore isn't respected. I already have .swp there and .swp files do not cause a problem... some problem in the ignore? EDIT2: Putting the gitignore pattern of *4913 works, but this is suboptimal (some files MAY end in 4913, after all). The pattern matching logic should probably be improved slightly, but for now I can use this workaround. |
Here's my config (pretty much default)
cat .config/autosync/pim
[autosync]
path = ~/.local/share/pim
pidfile = ~/.cache/autosync.pid
syncmethod = xmpp
pulllock = conservative
readfrequency = 5
ignorepath = .git .svn .hg
notice that in the target directory
~/.local/share/pim
, there is no file 4913, nor any file containing the string 4913 or whatever:$ find ~/.local/share/pim -name '4913'
$ grep -R 4913 ~/.local/share/pim
$
Yet, I have it quite often, when I change any file, dvcs-autosync detects a change on the file
4913
, tries to commit it, which obviously fails. Here is the output of an autosync session where I 1) start the program (with the config above), remove 12 lines from the filedvcs-autosync
in the watched directory.http://pastie.org/1778450
Interestingly, it receives a coalesce event for the file
dvcs-autosync
, then for the file4913
then again fordvcs-autosync
In
FileChangeHandler::_filter_and_handle_actions(self, args)
the args variable for the relevent call is this:DEBUG:root:['/home/dieter/.local/share/pim/4913', ['/home/dieter/.local/share/pim/4913']]
installed software:
pyinotify 0.9.1-1
python2 2.7.1-7
I have this issue with both the
develop
andmaster
branches, in fact I always had this issue with either version.The text was updated successfully, but these errors were encountered: