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

Re: [RFC, PATCH] RA context abstraction layer in libsvn_client

From: Ivan Zhakov <ivan_at_visualsvn.com>
Date: Wed, 10 Jul 2013 20:23:52 +0400

On Sat, Jun 15, 2013 at 3:34 PM, Ivan Zhakov <ivan_at_visualsvn.com> wrote:
> On Tue, Jun 11, 2013 at 3:22 PM, Ivan Zhakov <ivan_at_visualsvn.com> wrote:
>> Hi,
>>
>> Currently Subversion client layer creates new RA session for every
>> svn_client_* call. Even more: for some operations like
>> svn_client_merge() it creates 10-15 RA sessions. Each session creation
>> takes significant amount of time: TCP connection, SSL handshake,
>> authentication and initial handshake. It easily could take several
>> seconds over WAN.
>>
>> To solve this problem I propose to introduce RA context abstraction
>> layer for managing set of RA sessions for different repositories and
>> reuse them if possible. In the first version I made this layer
>> libsvn_client private, but in we can make it part of ra-loader in
>> future.
>>
>> The patch is attached. It passes all tests of course. I'm very
>> interested for feedback. Proposed solution should make our svn merge
>> code much easy to maintain and significantly faster.
>>
> I'll try to summarize concerns that were raised during the Hackathon
> and on mailing list:
> 1. svn_client_context_t can be used for long time by GUI clients. We
> need to deal with somehow.
> 2. De-facto ra_svn is stateful protocol and does not support
> restarting connection to server if it closed by server due timeout or
> restart.
> 3. svn+ssh also can be problem (stsp)
> 4. Currently serf library has a bug that serf_context_t need manual
> connection reset in case of error or cancellation during processing
> the request.
>
> Despite of that idea of reusing ra session considered as step in right
> direction. It should also fix issue 3763 [1] (checkout should re-use
> ra session for externals if possible).
>
> Current my current plain is following:
> 1. Add function like svn_client_close_all_sessions() to close all
> cached ra sessions
> 2. Add new RA capability to signal if RA session is reusable and
> stateless. Enable it for ra_local and ra_serf. Leave ra_svn not
> capable for reusing sessions.
> 3. Commit this change and start switching code to explicitly returning
> sessions back to cache to reuse them.
> 4. Extend ra_svn implementation and protocol to support connection
> restart and cheap session reparent.
>
> Is it makes sense?
>
> [1] http://subversion.tigris.org/issues/show_bug.cgi?id=3763
>
I've created 'reuse-ra-session' branch to finish my patch. I'm going
to merge it back to trunk with detailed log message, so branch
development should not be big problem.

-- 
Ivan Zhakov
Received on 2013-07-10 18:24:44 CEST

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.