Concerning Re: update hook per project (or dir
Ryan Schmidt wrote on 2 Mar 2007, 21:52, at least in part:
> On Mar 2, 2007, at 06:38, Andrew Brosnan wrote:
>
> > On 3/2/07 at 9:42 AM, Jan Hendrik wrote:
> >> But consider what happens to your website if the svn update
> >> execution fails for any reason
> >
> > the script needs to deal with that, i.e. - logging, error handling
> >
> >> or if there is another commit while
> >> the script still runs
> >
> > ...hmmm, I don't know. The script just runs svn up. What happens if
> > one user commits while another is running update? That should be OK.
>
> If the post-commit hook just runs svn update on the server's working
> copy, then the commit will not be completed until the update is done.
> Therefore, nobody can commit while the update is running. That would
> be a good thing.
Except if it happens to be a big commit/update, might block others
from committing for quite some time. If the post-commit hook
updating the server's working copy hangs, e.g. network problems,
probably forever, till someone goes in and kills the process.
> If, on the other hand, you have written your post-commit hook script
> to kick off the svn update process in its own thread and then return
> control, then the commit will complete right then, before the update
> is done, and another user could commit before the first user's update
> is complete. Then the second user's svn update will fail because the
> server's working copy will be locked, and your site will be missing
> the second user's updates, until someone else commits something.
Not familiar with threads, but I suppose it would be the same
thread as long as the post-commit hook script does the work itself.
But if it is just a wrapper for the actual script, e.g. post-commit.bat
calling server-update.py, then this would run in a different thread,
right?
> >> Guess this will be less of an
> >> issue if repository and the website wc are on the same machine,
> >
> > one is, a mirror is not
Wouldn't the mirror best be handled by a cron job completely
separate of svn repository and post-commit hooks?
> svn updates are not atomic. It is possible that the update could fail
> part of the way through, leaving you with a working copy that has
> some updates in it, and is missing some others. This becomes much
> more likely if the repository and the working copy are not on the
> same machine, because then network issues can affect the update.
At least a full svn update should be run at reasonable intervals to
make sure the server's working copy is really and completely
updated as kind of insurance against (partly) failed post-commit
updates. Or probably be part of error handling, though if a post-
commit update fails for network issues it is likely that another
attempt through error handling will fail just the same.
JH
---------------------------------------
Freedom quote:
You need only reflect that one of the best ways
to get yourself a reputation as a dangerous citizen these days
is to go about repeating the very phrases
which our founding fathers used in the great struggle for independence.
-- Charles Austin Beard (1874-1948)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Mar 6 17:30:52 2007