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

Re: Backgrounded script in post-commit blocks client commit completion

From: Johan Corveleyn <jcorvel_at_gmail.com>
Date: Tue, 19 Oct 2010 23:13:24 +0200

On Tue, Oct 19, 2010 at 11:04 PM, Kylo Ginsberg <kylo_at_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
Received on 2010-10-19 23:14:23 CEST

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.