You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Bert Huijben <be...@qqmail.nl> on 2015/02/06 13:55:21 UTC

RE: svn commit: r1657782 - /subversion/branches/reuse-ra-session/BRANCH-README


> -----Original Message-----
> From: brane@apache.org [mailto:brane@apache.org]
> Sent: vrijdag 6 februari 2015 12:10
> To: commits@subversion.apache.org
> Subject: svn commit: r1657782 - /subversion/branches/reuse-ra-
> session/BRANCH-README
> 
> Author: brane
> Date: Fri Feb  6 11:09:54 2015
> New Revision: 1657782
> 
> URL: http://svn.apache.org/r1657782
> Log:
> On the reuse-ra-session branch: Documentation change: Instead of expecting
> clients to manage the lifetime of idle sessions, expect that the RA cache
> implementation will take care of that itself and hide the complexity
> from the API.
> 
> * BRANCH-README:
>    Remove todo item about svn_client_close_all_sessions.
>    Add todo item about idle session expiry.

How do we expire idle sessions if a client only uses Subversion api's once a day?

I don't think we want to rely on timers or threads.


Before this is merged back I would really like some supported option to just close all sessions (perhaps including those to the working copy databases), without destroying the client context.

The context also caches credentials, etc.


In shared process environments such as Eclipse and Visual Studio where libsvn_client is indirectly used, we can't just always hold on to expensive/limited resources.


	Bert 


Re: svn commit: r1657782 - /subversion/branches/reuse-ra-session/BRANCH-README

Posted by Branko Čibej <br...@wandisco.com>.
On 06.02.2015 13:55, Bert Huijben wrote:
>
>> -----Original Message-----
>> From: brane@apache.org [mailto:brane@apache.org]
>> Sent: vrijdag 6 februari 2015 12:10
>> To: commits@subversion.apache.org
>> Subject: svn commit: r1657782 - /subversion/branches/reuse-ra-
>> session/BRANCH-README
>>
>> Author: brane
>> Date: Fri Feb  6 11:09:54 2015
>> New Revision: 1657782
>>
>> URL: http://svn.apache.org/r1657782
>> Log:
>> On the reuse-ra-session branch: Documentation change: Instead of expecting
>> clients to manage the lifetime of idle sessions, expect that the RA cache
>> implementation will take care of that itself and hide the complexity
>> from the API.
>>
>> * BRANCH-README:
>>    Remove todo item about svn_client_close_all_sessions.
>>    Add todo item about idle session expiry.
> How do we expire idle sessions if a client only uses Subversion api's once a day?

Why should such a client keep the context around for a whole day?

> I don't think we want to rely on timers or threads.

See r1657802.

> Before this is merged back I would really like some supported option to just close all sessions (perhaps including those to the working copy databases), without destroying the client context.
>
> The context also caches credentials, etc.
>
>
> In shared process environments such as Eclipse and Visual Studio where libsvn_client is indirectly used, we can't just always hold on to expensive/limited resources.

Context creation is relatively cheap, even considering credentials
caches and so on. No-one should have to keep a context around for hours,
let alone days.

Any implementation of close_all_sessions will have one of two drawbacks:

  * it will either close only the idle sessions, or
  * by closing all sessions, it will expose the user to nasty bugs
    related to keeping session references outside the context.

Clearing the context pool, on the other hand, avoids all these issues,
and avoids further clutter in the public API.

Until we actually see a client that treats contexts as heavy-weight
objects that require careful management, as opposed to large-yet-simple
objects that can be re-created any time they're needed, we certainly
don't need such explicit session management. And even then I'll argue
that said client is misusing our API.

-- Brane


Re: svn commit: r1657782 - /subversion/branches/reuse-ra-session/BRANCH-README

Posted by Ivan Zhakov <iv...@visualsvn.com>.
On 6 February 2015 at 16:50, Branko Čibej <br...@wandisco.com> wrote:
> On 06.02.2015 14:47, Ivan Zhakov wrote:
>> On 6 February 2015 at 16:13, Bert Huijben <be...@qqmail.nl> wrote:
>>>
>>>> -----Original Message-----
>>>> From: Ivan Zhakov [mailto:ivan@visualsvn.com]
>>>> Sent: vrijdag 6 februari 2015 14:04
>>>> To: Bert Huijben
>>>> Cc: Subversion Development
>>>> Subject: Re: svn commit: r1657782 - /subversion/branches/reuse-ra-
>>>> session/BRANCH-README
>>>>
>>>> On 6 February 2015 at 15:55, Bert Huijben <be...@qqmail.nl> wrote:
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: brane@apache.org [mailto:brane@apache.org]
>>>>>> Sent: vrijdag 6 februari 2015 12:10
>>>>>> To: commits@subversion.apache.org
>>>>>> Subject: svn commit: r1657782 - /subversion/branches/reuse-ra-
>>>>>> session/BRANCH-README
>>>>>>
>>>>>> Author: brane
>>>>>> Date: Fri Feb  6 11:09:54 2015
>>>>>> New Revision: 1657782
>>>>>>
>>>>>> URL: http://svn.apache.org/r1657782
>>>>>> Log:
>>>>>> On the reuse-ra-session branch: Documentation change: Instead of
>>>> expecting
>>>>>> clients to manage the lifetime of idle sessions, expect that the RA cache
>>>>>> implementation will take care of that itself and hide the complexity
>>>>>> from the API.
>>>>>>
>>>>>> * BRANCH-README:
>>>>>>    Remove todo item about svn_client_close_all_sessions.
>>>>>>    Add todo item about idle session expiry.
>>>>> How do we expire idle sessions if a client only uses Subversion api's once a
>>>> day?
>>>>> I don't think we want to rely on timers or threads.
>>>>>
>>>> One solution is to record last time RA session used and check it when
>>>> we're going to reuse this particular RA session.
>>> That doesn't reduce the usage of limited resources to until we try to use them later.
>>>
>> The limit on number of idle open RA sessions is already in TODO list:
>> - Limit the number of idle open sessions in the cache.
>
> No it's not. :)
>
Email is slower than Subversion developers :)


-- 
Ivan Zhakov

Re: svn commit: r1657782 - /subversion/branches/reuse-ra-session/BRANCH-README

Posted by Branko Čibej <br...@wandisco.com>.
On 06.02.2015 14:47, Ivan Zhakov wrote:
> On 6 February 2015 at 16:13, Bert Huijben <be...@qqmail.nl> wrote:
>>
>>> -----Original Message-----
>>> From: Ivan Zhakov [mailto:ivan@visualsvn.com]
>>> Sent: vrijdag 6 februari 2015 14:04
>>> To: Bert Huijben
>>> Cc: Subversion Development
>>> Subject: Re: svn commit: r1657782 - /subversion/branches/reuse-ra-
>>> session/BRANCH-README
>>>
>>> On 6 February 2015 at 15:55, Bert Huijben <be...@qqmail.nl> wrote:
>>>>
>>>>> -----Original Message-----
>>>>> From: brane@apache.org [mailto:brane@apache.org]
>>>>> Sent: vrijdag 6 februari 2015 12:10
>>>>> To: commits@subversion.apache.org
>>>>> Subject: svn commit: r1657782 - /subversion/branches/reuse-ra-
>>>>> session/BRANCH-README
>>>>>
>>>>> Author: brane
>>>>> Date: Fri Feb  6 11:09:54 2015
>>>>> New Revision: 1657782
>>>>>
>>>>> URL: http://svn.apache.org/r1657782
>>>>> Log:
>>>>> On the reuse-ra-session branch: Documentation change: Instead of
>>> expecting
>>>>> clients to manage the lifetime of idle sessions, expect that the RA cache
>>>>> implementation will take care of that itself and hide the complexity
>>>>> from the API.
>>>>>
>>>>> * BRANCH-README:
>>>>>    Remove todo item about svn_client_close_all_sessions.
>>>>>    Add todo item about idle session expiry.
>>>> How do we expire idle sessions if a client only uses Subversion api's once a
>>> day?
>>>> I don't think we want to rely on timers or threads.
>>>>
>>> One solution is to record last time RA session used and check it when
>>> we're going to reuse this particular RA session.
>> That doesn't reduce the usage of limited resources to until we try to use them later.
>>
> The limit on number of idle open RA sessions is already in TODO list:
> - Limit the number of idle open sessions in the cache.

No it's not. :)

-- Brane


Re: svn commit: r1657782 - /subversion/branches/reuse-ra-session/BRANCH-README

Posted by Ivan Zhakov <iv...@visualsvn.com>.
On 6 February 2015 at 16:13, Bert Huijben <be...@qqmail.nl> wrote:
>
>
>> -----Original Message-----
>> From: Ivan Zhakov [mailto:ivan@visualsvn.com]
>> Sent: vrijdag 6 februari 2015 14:04
>> To: Bert Huijben
>> Cc: Subversion Development
>> Subject: Re: svn commit: r1657782 - /subversion/branches/reuse-ra-
>> session/BRANCH-README
>>
>> On 6 February 2015 at 15:55, Bert Huijben <be...@qqmail.nl> wrote:
>> >
>> >
>> >> -----Original Message-----
>> >> From: brane@apache.org [mailto:brane@apache.org]
>> >> Sent: vrijdag 6 februari 2015 12:10
>> >> To: commits@subversion.apache.org
>> >> Subject: svn commit: r1657782 - /subversion/branches/reuse-ra-
>> >> session/BRANCH-README
>> >>
>> >> Author: brane
>> >> Date: Fri Feb  6 11:09:54 2015
>> >> New Revision: 1657782
>> >>
>> >> URL: http://svn.apache.org/r1657782
>> >> Log:
>> >> On the reuse-ra-session branch: Documentation change: Instead of
>> expecting
>> >> clients to manage the lifetime of idle sessions, expect that the RA cache
>> >> implementation will take care of that itself and hide the complexity
>> >> from the API.
>> >>
>> >> * BRANCH-README:
>> >>    Remove todo item about svn_client_close_all_sessions.
>> >>    Add todo item about idle session expiry.
>> >
>> > How do we expire idle sessions if a client only uses Subversion api's once a
>> day?
>> >
>> > I don't think we want to rely on timers or threads.
>> >
>> One solution is to record last time RA session used and check it when
>> we're going to reuse this particular RA session.
>
> That doesn't reduce the usage of limited resources to until we try to use them later.
>
The limit on number of idle open RA sessions is already in TODO list:
- Limit the number of idle open sessions in the cache.

I don't see problem with implementing svn_client_close_all_sessions().
My point was that Subversion should work fine (no connection timeout
errors) even application never calls svn_client_close_all_sessions().

-- 
Ivan Zhakov

RE: svn commit: r1657782 - /subversion/branches/reuse-ra-session/BRANCH-README

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: Ivan Zhakov [mailto:ivan@visualsvn.com]
> Sent: vrijdag 6 februari 2015 14:04
> To: Bert Huijben
> Cc: Subversion Development
> Subject: Re: svn commit: r1657782 - /subversion/branches/reuse-ra-
> session/BRANCH-README
> 
> On 6 February 2015 at 15:55, Bert Huijben <be...@qqmail.nl> wrote:
> >
> >
> >> -----Original Message-----
> >> From: brane@apache.org [mailto:brane@apache.org]
> >> Sent: vrijdag 6 februari 2015 12:10
> >> To: commits@subversion.apache.org
> >> Subject: svn commit: r1657782 - /subversion/branches/reuse-ra-
> >> session/BRANCH-README
> >>
> >> Author: brane
> >> Date: Fri Feb  6 11:09:54 2015
> >> New Revision: 1657782
> >>
> >> URL: http://svn.apache.org/r1657782
> >> Log:
> >> On the reuse-ra-session branch: Documentation change: Instead of
> expecting
> >> clients to manage the lifetime of idle sessions, expect that the RA cache
> >> implementation will take care of that itself and hide the complexity
> >> from the API.
> >>
> >> * BRANCH-README:
> >>    Remove todo item about svn_client_close_all_sessions.
> >>    Add todo item about idle session expiry.
> >
> > How do we expire idle sessions if a client only uses Subversion api's once a
> day?
> >
> > I don't think we want to rely on timers or threads.
> >
> One solution is to record last time RA session used and check it when
> we're going to reuse this particular RA session.

That doesn't reduce the usage of limited resources to until we try to use them later.

(See the rest of my previous mail)


We might also want to implement some timeouts in svnserve and backport those...
(In absence of a time machine)

And what about ssh clients...
(And limited number of per user sessions, etc.)

	Bert
> 
> 
> --
> Ivan Zhakov


Re: svn commit: r1657782 - /subversion/branches/reuse-ra-session/BRANCH-README

Posted by Ivan Zhakov <iv...@visualsvn.com>.
On 6 February 2015 at 15:55, Bert Huijben <be...@qqmail.nl> wrote:
>
>
>> -----Original Message-----
>> From: brane@apache.org [mailto:brane@apache.org]
>> Sent: vrijdag 6 februari 2015 12:10
>> To: commits@subversion.apache.org
>> Subject: svn commit: r1657782 - /subversion/branches/reuse-ra-
>> session/BRANCH-README
>>
>> Author: brane
>> Date: Fri Feb  6 11:09:54 2015
>> New Revision: 1657782
>>
>> URL: http://svn.apache.org/r1657782
>> Log:
>> On the reuse-ra-session branch: Documentation change: Instead of expecting
>> clients to manage the lifetime of idle sessions, expect that the RA cache
>> implementation will take care of that itself and hide the complexity
>> from the API.
>>
>> * BRANCH-README:
>>    Remove todo item about svn_client_close_all_sessions.
>>    Add todo item about idle session expiry.
>
> How do we expire idle sessions if a client only uses Subversion api's once a day?
>
> I don't think we want to rely on timers or threads.
>
One solution is to record last time RA session used and check it when
we're going to reuse this particular RA session.


-- 
Ivan Zhakov