monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] auto updates


From: Brian May
Subject: Re: [Monotone-devel] auto updates
Date: Sun, 29 Oct 2006 16:58:22 +1100
User-agent: Mutt/1.5.13 (2006-08-11)

On Sat, Oct 21, 2006 at 10:26:04AM +1000, Daniel Carosone wrote:
> On Sat, Oct 21, 2006 at 10:01:59AM +1000, Brian May wrote:
> > Why is a pull operation from a locked database better then an update
> > operation?
> 
> I think you missed the detail of which db is locked.
> 
> mtn -d serve.mtn serve --bind server:port ...
> 
> netsync hook triggers:
> 
> mtn -d update.mtn pull server:port ... && mtn -d update.mtn update ..

Mybe I am still confused, I would have though that pulling from a database
inside a hook that has been trigered by an update to that database would
cause lock contention.

Anyway, I tried that, but monotone hangs for ever - at the pull inside the
hook:

=== cut ===
Updating workspace for brian.test...
+ '[' -z launchpad.microcomaustralia.com.au:4691 -o -z
/home/monotone/pull.db -o -z /home/monotone/test -o -z brian.test ']'
+ SOURCE=launchpad.microcomaustralia.com.au:4691
+ PULLDB=/home/monotone/pull.db
+ WORKDIR=/home/monotone/test
+ BRANCH=brian.test
+ mtn pull --db=/home/monotone/pull.db
launchpad.microcomaustralia.com.au:4691 brian.test
mtn: doing anonymous pull; use -kKEYNAME if you need authentication
mtn: connecting to launchpad.microcomaustralia.com.au:4691
mtn: operation canceled: Interrupt
=== cut ===

(I pushed Ctrl+C to abort the server).

A potential problem I see (not related to the above) when I run the
above command manually, it tries to run the hook I have setup to run for
the server, and predictably these fail:

=== cut ===
address@hidden:~$ mtn pull --db=/home/monotone/pull.db
launchpad.microcomaustralia.com.au:4691 brian.test
mtn: doing anonymous pull; use -kKEYNAME if you need authentication
mtn: connecting to launchpad.microcomaustralia.com.au:4691
mtn: finding items to synchronize:
mtn: certificates | keys | revisions
mtn:           15 |    2 |         5
mtn: bytes in | bytes out | certs in | revs in
mtn:   11.9 k |     1.7 k |    20/20 |     5/5
mtn: successful exchange with launchpad.microcomaustralia.com.au:4691

Updating workspace for brian.test...
+ '[' -z launchpad.microcomaustralia.com.au:4691 -o -z
/home/monotone/pull.db -o -z /home/monotone/test -o -z brian.test ']'
+ SOURCE=launchpad.microcomaustralia.com.au:4691
+ PULLDB=/home/monotone/pull.db
+ WORKDIR=/home/monotone/test
+ BRANCH=brian.test
+ mtn pull --db=/home/monotone/pull.db
launchpad.microcomaustralia.com.au:4691 brian.test
mtn: error: sqlite error: database is locked
...done (1)
=== cut ===

This is a situation where being able to tell what database is being
used by the hook function would be a good idea IMHO.

For now I worked around it by specifying --rcfile to the server, so
only the server sees my hooks. The hangs still occur.

=== cut ===
address@hidden:~$ ps fx
  PID TTY      STAT   TIME COMMAND
 5762 tty1     S      0:00 su monotone -
 5763 tty1     S      0:00  \_ bash -
 5781 tty1     S+     0:00      \_ mtn serve * --db=~/test.db 
--rcfile=.monotone 5783 tty1     S+     0:00          \_ /bin/sh -ex 
/home/monotone/update launchp 5784 tty1     S+     0:00              \_ mtn 
pull --db=/home/monotone/pull.db
 5694 pts/0    S      0:00 su monotone
 5695 pts/0    S      0:00  \_ bash
 5785 pts/0    R+     0:00      \_ ps fx
address@hidden:~$ strace -p 5784
Process 5784 attached - interrupt to quit
select(12, [11], [], [11], {21501, 32000} <unfinished ...>
Process 5784 detached
=== cut ===

-- 
Brian May <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]