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

Re: post-commit

From: Ryan Schmidt <subversion-2006d_at_ryandesign.com>
Date: 2006-11-29 06:33:18 CET

On Nov 28, 2006, at 19:00, Lutz Frommberger wrote:

> Ronan Lucio wrote:
>
>> Is there anyone using subversion for a website?
>
> Me.

Me too.

>> How do you do to update the website?
>
> I threw away post-commit, it never worked as expected. It is really
> a miracle how this mechanism can perform that badly.

It works completely reliably for me. A problem though is that control
is not returned to the client until the post-commit hook ends. If you
do a lengthy process in the post-commit hook, this can make your
clients wait. And depending on the number of items and in particular
the number of directories in your working copy, an svn update can
take awhile, so this is something to consider. If one user tries to
commit while another user is still waiting for their commit to
finish, then there's even more delay. You can kick off the update
process to start in the background so that control is returned to the
user sooner, à la "/usr/bin/svn update &", but what happens if one
user commits, kicks off the update, and a 2nd user commits while the
update is still running? The second Subversion invokation prints an
error message saying the working copy is locked and then exits, and
when the first update process is done, the working copy is still
missing the latest changes, which it will not receive until the next
time someone commits and the post-commit update runs again successfully.

> All post-commit does is setting a flag somewhere, and then a cron
> job running every minute looks for this flag and executes a certain
> script. This has also the advantage that setting locks is very easy,
> so that race-conditions can be avoided.

And that can be a good solution to the above problems, if
instantaneous updates of the web site are not essential.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Nov 29 06:34:03 2006

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.