← Back to team overview

dulwich-users team mailing list archive

Re: RFC: Closing resources and controlling cache life times

 

On Tue, Apr 28, 2015 at 2:58 PM, Gary van der Merwe <garyvdm@xxxxxxxxx>
wrote:

> Once you call close() on a Repo/ObjectStore/Pack, that object becomes
> unusable when mmap is being used for packs. Hence having a single context
> manager not work one wanted to keep a Repo object open for a long time,
> while still picking up writes happening in other processes. e.g. if we
> writing a web server that used the same Repo object for multiple requests.
>

Sorry, I need to to make a correction here. ObjectStore objects are usable
after you close them, because they discard and recreate the necessary Pack
objects. The points still stands, controlling the cache life time, and when
objects get closed should be independent.

References