[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: Tue, 11 Jun 2013 16:20:00 +0200

On Tue, Jun 11, 2013 at 3:56 PM, Bert Huijben <bert_at_qqmail.nl> 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.
>>
>> [[[
>> Introduce repository access abstraction layer for managing RA session for
>> different repositories.
>>
>> * subversion/include/private/svn_client_private.h
>> (svn_client__ra_session_release): New.
>> (svn_client__ra_session_from_path2): Document that created session will
>> be
>> automatically returned back to RA session cache on pool cleanup.
>>
>> * subversion/libsvn_client/ra.c
>> (): Include ra_ctx.h.
>> (svn_client__open_ra_session_internal): Use
>> svn_client__ra_session_open().
>> (svn_client__ra_session_release): New. Wrapper around
>> svn_client__ra_ctx_release_session()
>>
>> * subversion/include/svn_client.h
>> (svn_client_ctx_t): Add RA_CTX member.
>>
>> * subversion/libsvn_client/ctx.c
>> (): Include ra_ctx.h.
>> (svn_client_create_context2): Initialize RA_CTX.
>
> I haven't looked at the code yet, but is this going to work for clients that keep a
> svn_client_context_t instance for hours/days/weeks?
> All that time reusing it for different operations every now and then.
> (One step further: How would this be affected by configuration and/or authorization baton changes when there are sessions cached)
>
> Existing TCP connections (w/c)ould be broken on the next usage, kerberos cookies could have expired, etc. etc., especially with ra_svn, but maybe also with ra_serf where an existing connection can be reused in some cases.
>
It should be working fine, the only problem is ra_svn. But it should
be relatively easy to solve. RA session should be restartable anyway.

-- 
Ivan Zhakov
CTO | VisualSVN | http://www.visualsvn.com
Received on 2013-06-11 16:20:52 CEST

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