[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Are post-commit hooks atomic?

From: Stefan Haller <haller_at_ableton.com>
Date: 2004-09-19 19:58:16 CEST

Max Bowsher <maxb@ukf.net> wrote:

> Stefan Haller wrote:
> > Ben Collins-Sussman <sussman@collab.net> wrote:
> >
> >> So running a 2nd 'svn up' will just error out as soon as it hits the
> >> other process' lockfile.
> >
> > But then it's not guaranteed that the checked-out live copy is always up
> > to date, is it? (If the last post-commit hook errors out because the
> > previous one is still running.)
>
> True.
>
> Sounds like you need to have your post-commit wait for and acquire a lock
> whilst it is running.

Yes, that's what we did with CVS; I just wanted to be certain whether we
still have to do it with subversion.

(Actually, waiting for a lock is not a suitable solution, because if,
say, five more commits happen while a post-commit hook is still running,
you don't want to run five more "svn up" afterwards, but only one. This
can easily happen with a very large repository. What we did is try to
acquire the lock, and if it fails, touch a "there are updates pending"
file (guarded by another lock); if we manage to acquire the lock, we run
"cvs up" in a loop as long as the "there are updates pending" file
exists. I think I should clean up the code a bit and submit it for the
contrib directory, since it is a solution to what I think must be a very
common problem.)

-- 
Stefan Haller
Ableton
http://www.ableton.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sun Sep 19 19:59:20 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.