You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Alan Barrett <ap...@cequrux.com> on 2006/03/21 15:34:40 UTC
kill(pid_of_ssh, SIGKILL) is rude
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. I had
hundreds of temporary files lying around before I figured out why my
wrapper wasn't deleting its temporary files: svn was rudely killing it!
I see the comments in the source about why svn does this. I suspect
that the real problem could be solved by a strategy like this:
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)
--apb (Alan Barrett)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: kill(pid_of_ssh, SIGKILL) is rude
Posted by Alan Barrett <ap...@cequrux.com>.
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
<http://svn.haxx.se/users/archive-2005-11/0186.shtml>.
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
Re: kill(pid_of_ssh, SIGKILL) is rude
Posted by Vincent Lefevre <vi...@vinc17.org>.
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. I had
> hundreds of temporary files lying around before I figured out why my
> wrapper wasn't deleting its temporary files: svn was rudely killing it!
[...]
There has already been a thread about that:
Date: Fri, 04 Nov 2005 21:52:58 +0100
Subject: svn+ssh breaks with ControlSocket
--
Vincent Lefèvre <vi...@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org