You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Garrett Rooney <ro...@electricjellyfish.net> on 2003/01/04 02:06:06 UTC

problem with 'svn diff -r FOO:BAR' over ra_svn

so i just ran into an odd problem with ra_svn.  if i run it in tunnel 
mode (over ssh), and do a diff between two different revisions, it just 
hangs.  there are two instances of svnserve running as a result, both 
sitting in readbuf_fill, and the svn process is stuck in ra_svn_close.  
running svnserve in daemon mode works fine.

to reproduce this, just put the following in your .subversion/servers:

[groups]
localhost = localhost

[localhost]
svn-tunnel-agent = ssh

then create a repository with a few revisions in it and try to run 'svn 
diff -r 1:2 svn://localhost/path/to/repos'.

anyone got any ideas?

-garrett


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: problem with 'svn diff -r FOO:BAR' over ra_svn

Posted by Greg Hudson <gh...@MIT.EDU>.
On Sat, 2003-01-04 at 00:01, Greg Hudson wrote:
> I will figure out the appropriate APR magic to set the file descriptors
> close-on-exec.

Easier said than done, it seems.

APR doesn't know about FD_CLOEXEC, presumably because there's no
non-Unix analog.  It does have child cleanups (cleanups which get run in
apr_proc_create() after the fork and before the exec), which it sets up
inconsistently for different kinds of apr_file objects.  Most file
objects are set up to be closed in the child (which creates a
double-buffer-flushing bug I've mentioned in the past; we may have to
add some flushes to avoid that).  Pipe file objects are set up without a
child cleanup handler--a little odd, since apr_proc_create() has special
logic to avoid triggering those child cleanups.

It seems like apr_file should have a flag for whether a file object gets
cleaned up in the child process (and the child cleanups should be
special routines which don't flush buffers).  But that sounds like a lot
of work.  In the meantime, I guess we should set up our own child
cleanups on the pipes.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: problem with 'svn diff -r FOO:BAR' over ra_svn

Posted by Greg Hudson <gh...@MIT.EDU>.
I think I know what's going on.

ra_svn_close() relies on

      apr_file_close(conn->in_file);
      apr_file_close(conn->out_file);

to cause the child ssh process to exit.  But when the second ssh process
is created, it inherits the file descriptors from the first ssh
process.  So those file descriptors are held open, and the ssh does not
know to exit.

I will figure out the appropriate APR magic to set the file descriptors
close-on-exec.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org