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

Re: svnserve could save its PID somewhere

From: Tobias Ringström <tobias_at_ringstrom.mine.nu>
Date: 2004-06-20 20:22:44 CEST

Branko Čibej wrote:
> Tobias Ringström wrote:
>> On unix, svnserve uses fork by default. The main process is only a TCP
>> listener and it does not open the repository. For each connection a
>> child is forked that opens the repository. As long as you only kill
>> the main process you're safe,
>
> Well, at least closing the sockets and such would be nice, although it's
> not strictly necessary.

Oops, I see that the children are not closing the listening socket. As
you say it's not strictly neccessary, but it's still a bug. I'll fix
it. It should be a one-liner.

>> but if you kill one of the children, the repository will need
>> recovery. There is no way to safely stop a threaded svnserve, though. :-(
>
> Shouldn't be hard to do. You still have to catch the signal, then have
> the main thread simply terminate. The process should wither away once
> the other threads have exited, I think. But we do need the sighnal
> handlers. Also, svnserve should reread its config files (if any) if it
> sees a SIGHUP. That's just common behaviour.

AFAIK, if you exit from main, all threads get terminated. You need to
create the threads without making them detached, and then call join
before returning from main. It's not a big thing, but it requires some
housekeeping. It would be useful to implement a maximum number of
clients at the same time, and a timeout for the clients.

/Tobias

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Jun 20 20:23:23 2004

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.