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

Re: kill(pid_of_ssh, SIGKILL) is rude

From: Alan Barrett <apb_at_cequrux.com>
Date: 2006-03-22 09:07:42 CET

On Wed, 22 Mar 2006, Vincent Lefevre wrote:
> On 2006-03-21 17:34:40 +0200, Alan Barrett wrote:
> > When using the svn+ssh access method, svn kills the ssh process with
> > SIGKILL (a.k.a "kill -9"). This doesn't give ssh (or a wrapper invoked
> > via the SVN_SSH environment variable) a chance to clean up.
> There has already been a thread about that:
> Date: Fri, 04 Nov 2005 21:52:58 +0100
> Subject: svn+ssh breaks with ControlSocket

Thanks. That's archived at

I stand by my suggestion to

    wait a few seconds to see whether ssh exits by itself;
    if not, then kill(pid_of_ssh, SIGTERM);
    wait a few more seconds to see whether ssh exits by itself;
    if not, then kill(pid_of_ssh, SIGKILL).

The "unsightly stderr output from ssh" mentioned in the comment in
libsvn_ra_svn/client.c will not appear if ssh exits by itself during the
first few seconds before the SIGTERM is sent. I'd suggest a 5-second
delay before the SIGTERM, and another 3 seconds before the SIGKILL.
My testing (with ssh to localhost, and with a wrapper script that
effectively ignores SIGKILL by doing the real work in a background
process) did not encounter a case where ssh took more than 1 second to
exit cleanly.

--apb (Alan Barrett)

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Mar 22 09:09:18 2006

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