summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Assistant/Threads/Committer.hs16
-rw-r--r--Assistant/Threads/Watcher.hs5
-rw-r--r--debian/changelog1
-rw-r--r--doc/bugs/Too_many_open_files.mdwn4
-rw-r--r--doc/bugs/git-annex:_WebDAV_failed_to_write_file:_TlsNotSupported:_user_error.mdwn2
-rw-r--r--doc/builds.mdwn3
-rw-r--r--doc/design/external_special_remote_protocol.mdwn63
-rw-r--r--doc/devblog/day_81__more_standalone.mdwn15
8 files changed, 72 insertions, 37 deletions
diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs
index f736530e4..2ddaade2f 100644
--- a/Assistant/Threads/Committer.hs
+++ b/Assistant/Threads/Committer.hs
@@ -52,7 +52,7 @@ commitThread = namedThread "Committer" $ do
=<< annexDelayAdd <$> Annex.getGitConfig
waitChangeTime $ \(changes, time) -> do
readychanges <- handleAdds havelsof delayadd changes
- if shouldCommit time (length readychanges) readychanges
+ if shouldCommit False time (length readychanges) readychanges
then do
debug
[ "committing"
@@ -94,16 +94,17 @@ waitChangeTime a = waitchanges 0
let len = length changes
-- See if now's a good time to commit.
now <- liftIO getCurrentTime
- case (lastcommitsize >= maxCommitSize, shouldCommit now len changes, possiblyrename changes) of
+ scanning <- not . scanComplete <$> getDaemonStatus
+ case (lastcommitsize >= maxCommitSize, shouldCommit scanning now len changes, possiblyrename changes) of
(True, True, _)
| len > maxCommitSize ->
- waitchanges =<< a (changes, now)
+ a (changes, now) >>= waitchanges
| otherwise -> aftermaxcommit changes
(_, True, False) ->
- waitchanges =<< a (changes, now)
+ a (changes, now) >>= waitchanges
(_, True, True) -> do
morechanges <- getrelatedchanges changes
- waitchanges =<< a (changes ++ morechanges, now)
+ a (changes ++ morechanges, now) >>= waitchanges
_ -> do
refill changes
waitchanges lastcommitsize
@@ -199,8 +200,9 @@ maxCommitSize = 5000
- Current strategy: If there have been 10 changes within the past second,
- a batch activity is taking place, so wait for later.
-}
-shouldCommit :: UTCTime -> Int -> [Change] -> Bool
-shouldCommit now len changes
+shouldCommit :: Bool -> UTCTime -> Int -> [Change] -> Bool
+shouldCommit scanning now len changes
+ | scanning = len >= maxCommitSize
| len == 0 = False
| len >= maxCommitSize = True
| length recentchanges < 10 = True
diff --git a/Assistant/Threads/Watcher.hs b/Assistant/Threads/Watcher.hs
index d9afb9adf..50a0efdd5 100644
--- a/Assistant/Threads/Watcher.hs
+++ b/Assistant/Threads/Watcher.hs
@@ -144,6 +144,11 @@ startupScan scanner = do
modifyDaemonStatus_ $ \s -> s { scanComplete = True }
+ -- Ensure that the Committer sees any changes
+ -- that it did not process, and acts on them now that
+ -- the scan is complete.
+ refillChanges =<< getAnyChanges
+
return (True, r)
{- Hardcoded ignores, passed to the DirWatcher so it can avoid looking
diff --git a/debian/changelog b/debian/changelog
index 8b8968c4d..628307671 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,7 @@ git-annex (5.20131214) UNRELEASED; urgency=low
* Include man pages in Linux and OSX standalone builds.
* Linux standalone build now includes its own glibc and forces the linker to
use it, to remove dependence on the host glibc.
+ * assistant: Always batch changes found in startup scan.
-- Joey Hess <joeyh@debian.org> Sun, 15 Dec 2013 13:32:49 -0400
diff --git a/doc/bugs/Too_many_open_files.mdwn b/doc/bugs/Too_many_open_files.mdwn
index 3bb53e74d..53c9bb690 100644
--- a/doc/bugs/Too_many_open_files.mdwn
+++ b/doc/bugs/Too_many_open_files.mdwn
@@ -53,3 +53,7 @@ git-annex: runInteractiveProcess: pipe: Too many open files
# End of transcript or log.
"""]]
+
+> This appears to be the same problem as [[Resource_exhausted]],
+> so closing as duplicate; please follow up to the other bug report if
+> possible. [[done]] --[[Joey]]
diff --git a/doc/bugs/git-annex:_WebDAV_failed_to_write_file:_TlsNotSupported:_user_error.mdwn b/doc/bugs/git-annex:_WebDAV_failed_to_write_file:_TlsNotSupported:_user_error.mdwn
index 12fac38d1..b7c67e398 100644
--- a/doc/bugs/git-annex:_WebDAV_failed_to_write_file:_TlsNotSupported:_user_error.mdwn
+++ b/doc/bugs/git-annex:_WebDAV_failed_to_write_file:_TlsNotSupported:_user_error.mdwn
@@ -31,3 +31,5 @@ ArchLinux
# End of transcript or log.
"""]]
+
+> [[done]] --[[Joey]]
diff --git a/doc/builds.mdwn b/doc/builds.mdwn
index 49dfc8859..2823cdb93 100644
--- a/doc/builds.mdwn
+++ b/doc/builds.mdwn
@@ -6,6 +6,9 @@
<h2>Linux amd64</h2>
<iframe width=1024 scrolling=no frameborder=0 marginheight=0 marginwidth=0 src="https://downloads.kitenet.net/git-annex/autobuild/amd64/">
</iframe>
+<h2>Linux armel</h2>
+<iframe width=1024 scrolling=no frameborder=0 marginheight=0 marginwidth=0 src="https://downloads.kitenet.net/git-annex/autobuild/armel/">
+</iframe>
<h2>Android</h2>
<iframe width=1024 scrolling=no frameborder=0 marginheight=0 marginwidth=0 src="https://downloads.kitenet.net/git-annex/autobuild/android/">
</iframe>
diff --git a/doc/design/external_special_remote_protocol.mdwn b/doc/design/external_special_remote_protocol.mdwn
index 2c3fd2a4e..19640fb7f 100644
--- a/doc/design/external_special_remote_protocol.mdwn
+++ b/doc/design/external_special_remote_protocol.mdwn
@@ -22,6 +22,10 @@ progress to stdout. (Such stuff can be sent to stderr instead.)
The protocol is line based. Messages are sent in either direction, from
git-annex to the special remote, and from the special remote to git-annex.
+In order to avoid confusing interactions, one or the other has control
+at any given time, and is responsible for sending requests, while the other
+only sends replies to the requests.
+
## example session
The special remote is responsible for sending the first message, indicating
@@ -38,9 +42,9 @@ The special remote can now ask git-annex for its configuration, as needed,
and check that it's valid. git-annex responds with the configuration values
GETCONFIG directory
- /media/usbdrive/repo
+ VALUE /media/usbdrive/repo
GETCONFIG automount
- true
+ VALUE true
Once the special remote is satisfied with its configuration and is
ready to go, it tells git-annex.
@@ -104,10 +108,9 @@ send one of the corresponding replies listed in the next section.
## special remote replies
These should be sent only in response to the git-annex request messages.
-(Any sent unexpectedly will be ignored.)
They do not have to be sent immediately after the request; the special
-remote can send other messages and queries (listed in sections below)
-as it's performing the request.
+remote can send its own requests (listed in the next section below)
+while it's handling a request.
* `PREPARE-SUCCESS`
Sent as a response to PREPARE once the special remote is ready for use.
@@ -143,50 +146,50 @@ as it's performing the request.
## special remote messages
-These are messages the special remote program can send to
-git-annex at any time. It should not expect any response from git-annex.
+These messages may be sent by the special remote at any time that it's
+in control.
* `VERSION Int`
Supported protocol version. Current version is 0. Must be sent first
thing at startup, as until it sees this git-annex does not know how to
talk with the special remote program!
-* `ERROR ErrorMsg`
- Generic error. Can be sent at any time if things get messed up.
- When possible, use a more specific reply from the list above.
- It would be a good idea to send this if git-annex sends a command
- you do not support. The program should exit after sending this, as
- git-annex will not talk to it any further.
* `PROGRESS STORE|RETRIEVE Key Int`
Indicates the current progress of the transfer. May be repeated any
number of times during the transfer process. This is highly recommended
- for STORE. (It is optional but good for RETRIEVE.)
-
-## special remote queries
-
-After git-annex has sent the special remote a request, and before the
-special remote sends back a reply, git-annex enters quiet mode. It will
-avoid sending additional messages. While git-annex is in quiet mode,
-the special remote can send queries to it. Queries can not be sent at any
-other time.
-
-When it sees a query, git-annex will respond a line containing
-*only* the requested data.
-
+ for STORE. (It is optional but good for RETRIEVE.)
+ (git-annex does not send a reply to this message.)
* `DIRHASH Key`
Gets a two level hash associated with a Key. Something like "abc/def".
This is always the same for any given Key, so can be used for eg,
- creating hash directory structures to store Keys in.
+ creating hash directory structures to store Keys in.
+ (git-annex replies with VALUE followed by the value.)
* `GETCONFIG Setting`
- Gets one of the special remote's configuration settings.
+ Gets one of the special remote's configuration settings.
+ (git-annex replies with VALUE followed by the value.)
* `SETSTATE Key Value`
git-annex can store state in the git-annex branch on a
- per-special-remote, per-key basis. This sets that state.
+ per-special-remote, per-key basis. This sets that state.
+ (git-annex replies with VALUE followed by the value stored.)
* `GETSTATE Key`
Gets any state previously stored for the key from the git-annex branch.
Note that some special remotes may be accessed from multiple
repositories, and the state is only eventually consistently synced
between them. If two repositories set different values in the state
- for a key, the one that sets it last wins.
+ for a key, the one that sets it last wins.
+ (git-annex replies with VALUE followed by the value.)
+
+## general messages
+
+These messages can be sent at any time by either git-annex or the special
+remote.
+
+* `ERROR ErrorMsg`
+ Generic error. Can be sent at any time if things get messed up.
+ When possible, use a more specific reply from the list above.
+ It would be a good idea to send this if git-annex sends a command
+ you do not support. The program should exit after sending this, as
+ git-annex will not talk to it any further. If the program receives
+ an ERROR, it can try to recover, or exit with its own ERROR.
## Simple shell example
diff --git a/doc/devblog/day_81__more_standalone.mdwn b/doc/devblog/day_81__more_standalone.mdwn
new file mode 100644
index 000000000..646f280c1
--- /dev/null
+++ b/doc/devblog/day_81__more_standalone.mdwn
@@ -0,0 +1,15 @@
+Made the Linux standalone builds more self-contained, now they include
+their own linker and glibc, and ugly hacks to make them be used when
+running the included programs. This should make them more portable
+to older systems.
+
+Set up an arm autobuilder.
+This autobuilder runs in an Debian armel chroot, using
+qemu-user-static (with a patch to make it support some syscalls ghc uses).
+No webapp yet; waiting on feedback of how well it works. I *hope* this
+build will be usable on eg, Synology NAS and Raspberry PI.
+
+Also worked on improving the assistant's batching of commits during the
+startup scan. And some other followups and bug triage.
+
+Today's work was sponsored by Hamish Coleman.