summaryrefslogtreecommitdiff
path: root/Assistant/Threads/SanityChecker.hs
Commit message (Collapse)AuthorAge
* rename prompt since Messages added a function by that nameGravatar Joey Hess2017-05-15
|
* AssociatedFile newtypeGravatar Joey Hess2017-03-10
| | | | | | To prevent any further mistakes like 1a497cefb47557f0b4788c606f9071be422b2511 This commit was sponsored by Francois Marier on Patreon.
* add KeyVariety typeGravatar Joey Hess2017-02-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Where before the "name" of a key and a backend was a string, this makes it a concrete data type. This is groundwork for allowing some varieties of keys to be disabled in file2key, so git-annex won't use them at all. Benchmarks ran in my big repo: old git-annex info: real 0m3.338s user 0m3.124s sys 0m0.244s new git-annex info: real 0m3.216s user 0m3.024s sys 0m0.220s new git-annex find: real 0m7.138s user 0m6.924s sys 0m0.252s old git-annex find: real 0m7.433s user 0m7.240s sys 0m0.232s Surprising result; I'd have expected it to be slower since it now parses all the key varieties. But, the parser is very simple and perhaps sharing KeyVarieties uses less memory or something like that. This commit was supported by the NSF-funded DataLad project.
* get, move, copy, mirror: Added --failed switch which retries failed copies/movesGravatar Joey Hess2016-08-03
| | | | | | | | | Note that get --from foo --failed will get things that a previous get --from bar tried and failed to get, etc. I considered making --failed only retry transfers from the same remote, but it was easier, and seems more useful, to not have the same remote requirement. Noisy due to some refactoring into Types/
* remove 163 lines of code without changing anything except importsGravatar Joey Hess2016-01-20
|
* add VerifiedCopy data typeGravatar Joey Hess2015-10-08
| | | | | | | | | There should be no behavior changes in this commit, it just adds a more expressive data type and adjusts code that had been passing around a [UUID] or sometimes a Maybe Remote to instead use [VerifiedCopy]. Although, since some functions were taking two different [UUID] lists, there's some potential for me to have gotten it horribly wrong.
* When re-execing git-annex, use current program location, rather than ↵Gravatar Joey Hess2015-02-28
| | | | | | | | | | | | | | | | | | ~/.config/git-annex/program, when possible. Most of the time, there will be no discreprancy between programPath and readProgramFile. But, the programFile might have been written by an old version of git-annex that is still installed, while a newer one is currently running. In this case, we want to run the same one that's currently running. This is especially important for things like the GIT_SSH=git-annex used for ssh connection caching. The only code that still uses readProgramFile directly is the upgrade code, which needs to know where the standalone git-annex was installed, in order to upgrade it.
* update my email address and homepage urlGravatar Joey Hess2015-01-21
|
* add getFileSize, which can get the real size of a large file on WindowsGravatar Joey Hess2015-01-20
| | | | | | | | | | | | | | Avoid using fileSize which maxes out at just 2 gb on Windows. Instead, use hFileSize, which doesn't have a bounded size. Fixes support for files > 2 gb on Windows. Note that the InodeCache code only needs to compare a file size, so it doesn't matter it the file size wraps. So it has been left as-is. This was necessary both to avoid invalidating existing inode caches, and because the code passed FileStatus around and would have become more expensive if it called getFileSize. This commit was sponsored by Christian Dietrich.
* fixed all remaining build warnings on WindowsGravatar Joey Hess2014-12-29
|
* fix some mixed space+tab indentationGravatar Joey Hess2014-10-09
| | | | | | | | | This fixes all instances of " \t" in the code base. Most common case seems to be after a "where" line; probably vim copied the two space layout of that line. Done as a background task while listening to episode 2 of the Type Theory podcast.
* assistant: Detect when repository has been deleted or moved, and ↵Gravatar Joey Hess2014-09-15
| | | | automatically shut down the assistant. Closes: #761261
* unify exception handling into Utility.ExceptionGravatar Joey Hess2014-08-07
| | | | | | | | | | | | | | | | | | | | Removed old extensible-exceptions, only needed for very old ghc. Made webdav use Utility.Exception, to work after some changes in DAV's exception handling. Removed Annex.Exception. Mostly this was trivial, but note that tryAnnex is replaced with tryNonAsync and catchAnnex replaced with catchNonAsync. In theory that could be a behavior change, since the former caught all exceptions, and the latter don't catch async exceptions. However, in practice, nothing in the Annex monad uses async exceptions. Grepping for throwTo and killThread only find stuff in the assistant, which does not seem related. Command.Add.undo is changed to accept a SomeException, and things that use it for rollback now catch non-async exceptions, rather than only IOExceptions.
* remove unused importGravatar Joey Hess2014-07-04
|
* reorgGravatar Joey Hess2014-07-04
| | | | | | avoid Git.Command needing Utility.Batch which needs async For github-backup etc
* Windows: Assistant now logs to daemon.log.Gravatar Joey Hess2014-06-17
| | | | | | | Yes, this means that git annex webapp on windows execs git-annex, which execs itself to set env, and the execs itself again to redirect logs. This is disgusting. This is Windows(TM).
* assistant: Make sanity checker tmp dir cleanup code more robust.Gravatar Joey Hess2014-05-30
|
* assistant: Clean up stale tmp files on startup.Gravatar Joey Hess2014-04-27
| | | | This commit was sponsored by Melissa Binde.
* assistant: Smarter log file rotation, which takes free disk space into account.Gravatar Joey Hess2014-03-05
|
* fix all remaining -Wall warnings on WindowsGravatar Joey Hess2014-02-25
|
* fix windows buildGravatar Joey Hess2014-02-11
|
* Fix build on platforms not supporting the webapp.Gravatar Joey Hess2014-02-08
|
* fix delay of daily sanity check (hacked for testing and accidentially committed)Gravatar Joey Hess2014-01-23
|
* try to drop unused object if it does not need to be transferred anywhereGravatar Joey Hess2014-01-23
|
* add webapp UI to manage unused filesGravatar Joey Hess2014-01-23
|
* allow annex.expireunused to be set to false, as well as to a durationGravatar Joey Hess2014-01-22
|
* assistant unused file handlingGravatar Joey Hess2014-01-22
| | | | | | | | | | | | | | | | | | | Make sanity checker run git annex unused daily, and queue up transfers of unused files to any remotes that will have them. The transfer retrying code works for us here, so eg when a backup disk remote is plugged in, any transfers to it are done. Once the unused files reach a remote, they'll be removed locally as unwanted. If the setup does not cause unused files to go to a remote, they'll pile up, and the sanity checker detects this using some heuristics that are pretty good -- 1000 unused files, or 10% of disk used by unused files, or more disk wasted by unused files than is left free. Once it detects this, it pops up an alert in the webapp, with a button to take action. TODO: Webapp UI to configure this, and also the ability to launch an immediate cleanup of all unused files. This commit was sponsored by Simon Michael.
* assistant: Run the periodic git gc in batch mode.Gravatar Joey Hess2014-01-22
|
* assistant: Detect if .git/annex/index is corrupt at startup, and recover.Gravatar Joey Hess2014-01-14
|
* assistant: Set StrictHostKeyChecking yes when creating ssh remotes, and add ↵Gravatar Joey Hess2013-12-20
| | | | it to the configuration for any ssh remotes previously created by the assistant. This avoids repeated prompts by ssh if the host key changes, instead syncing with such a remote will fail. Closes: #732602
* Improve repair of git-annex index file.Gravatar Joey Hess2013-12-10
| | | | | | | | | | Fixes a test case I received where a corrupted repo was repaired, but the git-annex branch was not. The root of the problem was that the MissingObject returned by the repair code was not necessarily a complete set of all objects that might have been deleted during the repair. So, stop trying to return that at all, and instead make the index file checking code explicitly verify that each object the index uses is present.
* merge improved fsck types from git-repair and some associated changesGravatar Joey Hess2013-11-30
|
* log missing index at notice priorityGravatar Joey Hess2013-11-13
|
* inverted logicGravatar Joey Hess2013-11-13
|
* better handling of missing index fileGravatar Joey Hess2013-11-13
|
* assistant: Notice on startup when the index file is corrupt, and auto-repair.Gravatar Joey Hess2013-11-13
|
* webapp: remind user when using repositories that lack consistency checksGravatar Joey Hess2013-10-29
| | | | | | | | | | When starting up the assistant, it'll remind about the current repository, if it doesn't have checks. And when a removable drive is plugged in, it will remind if a repository on it lacks checks. Since that might be annoying, the reminders can be turned off. This commit was sponsored by Nedialko Andreev.
* add post-repair actionsGravatar Joey Hess2013-10-29
|
* fix stale git locks as part of repo repairGravatar Joey Hess2013-10-29
|
* move code around and rename thread; no functional changesGravatar Joey Hess2013-10-29
|
* assistant: When autostarted, wait 5 seconds before running the startup scan, ↵Gravatar Joey Hess2013-10-26
| | | | to avoid contending with the user's desktop login process.
* import: Skip .git directories.Gravatar Joey Hess2013-10-07
|
* assistant: Detect stale git lock files at startup time, and remove them.Gravatar Joey Hess2013-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Extends the index.lock handling to other git lock files. I surveyed all lock files used by git, and found more than I expected. All are handled the same in git; it leaves them open while doing the operation, possibly writing the new file content to the lock file, and then closes them when done. The gc.pid file is excluded because it won't affect the normal operation of the assistant, and waiting for a gc to finish on startup wouldn't be good. All threads except the webapp thread wait on the new startup sanity checker thread to complete, so they won't try to do things with git that fail due to stale lock files. The webapp thread mostly avoids doing that kind of thing itself. A few configurators might fail on lock files, but only if the user is explicitly trying to run them. The webapp needs to start immediately when the user has opened it, even if there are stale lock files. Arranging for the threads to wait on the startup sanity checker was a bit of a bear. Have to get all the NotificationHandles set up before the startup sanity checker runs, or they won't see its signal. Perhaps the NotificationBroadcaster is not the best interface to have used for this. Oh well, it works. This commit was sponsored by Michael Jakl
* hlintGravatar Joey Hess2013-10-02
|
* assistant: Daily sanity check thread is run niced.Gravatar Joey Hess2013-06-21
|
* fixed the race breaking moving files from archive in direct modeGravatar Joey Hess2013-03-04
| | | | | | | | | | | | | | | | | | | | | | assistant: Fix bug in direct mode that could occur when a symlink is moved out of an archive directory, and resulted in the file not being set to direct mode when it was transferred. The bug was that the direct mode mapping was not up-to-date when the transferrer finished. So, finding no direct mode place to store the object, it was put into .git/annex in indirect mode. To fix this, just make the watcher update the direct mode mapping to include the new file before it starts the transfer. (Seems we don't need to update it to remove the old file if the link was moved, because the direct mode code will notice it's not present and the mapping gets updated for its removal later.) The reason this was a race, and was probably not seen often is because the committer came along and updated the direct mode mapping as part of adding the moved symlink. But when the file was sufficiently small or the remote sufficiently fast, this could happen after the transfer finished.
* better prevention of auto repackGravatar Joey Hess2013-03-03
| | | | | | | | | | | | | Looking through the git sources (documentation is unclear), it seems commit doesn't ever trigger git-gc, mostly fetching and merging seems to. I cannot easily override the setting in all those places, so instead set gc.auto in git config when initializing a repository with the assistant. This does mean that the user cannot set gc.auto=0 and completely avoid repacks, as the assistant does it daily. But, it only does it after there are 100x the default number of loose objects, so this is probably not going to be too annoying.
* assistant: Prevent automatic commits from causing git-gc runs, as that can ↵Gravatar Joey Hess2013-03-03
| | | | make things quite slow. Instead, git-gc --auto is run once a day. (This can be disabled by the usual gc.auto=0 setting.)
* remove excess log rotation; openLog rotatesGravatar Joey Hess2013-03-01
|
* assistant: Logs are rotated to avoid them using too much disk space.Gravatar Joey Hess2013-03-01
| | | | | | This cannot completely guard against a runaway log event, and only runs every hour anyway, but it should avoid most problems with very long-running, active assistants using up too much space.