subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johan Corveleyn <jcor...@gmail.com>
Subject Re: Backgrounded script in post-commit blocks client commit completion
Date Tue, 19 Oct 2010 21:13:24 GMT
On Tue, Oct 19, 2010 at 11:04 PM, Kylo Ginsberg <kylo@kylo.net> wrote:
> Hi folks,
>
> I'm running 1.6.9 on Fedora 12.  With this post-commit script:
>
> #!/bin/sh
> REPOS="$1"
> REV="$2"
> $REPOS/hooks/delay.sh &
>
> and delay.sh is just:
>
> #!/bin/sh
> sleep 5
>
> This causes commits to delay 5 seconds before completing at the
> client.  Running post-commit directly from the command-line it returns
> immediately, so it is apparently something about how svn/apr invokes
> the hook.
>
> The above is a simplification; what I am really trying to do is put
> sync's to a proxy server in the background so that large commits
> aren't blocked while we sync to proxy servers across a WAN.
>
> I assume this is not expected behavior.  In fact the svnbook carefully
> describes putting proxy syncs in the background, so I believe I'm
> following best practices.

I think you have to redirect stdout and stderr to a file (or to
/dev/null if you wish). Something like:

$REPOS/hooks/delay.sh 2>&1 >logfile &

should do the trick.

I do this with my post-commit hook as well (for sending out commit
emails, don't want that to delay the commit), and it works perfectly.

Cheers,
-- 
Johan

Mime
View raw message