← Back to team overview

instant team mailing list archive

Re: [HG instant] Fix for not using cache, ffc should be fine.

 

However, with two processes, there will still be a race
condition during modification of the ~/.instant contents.
Not sure if there's an easy way to handle that.
We'll need some sort of locking mechanism on disk.

Since two users will have different cache directories,
this won't be a problem in that case, and better tempdir
naming is enough.

-- 
Martin



2008/9/1 Martin Sandve Alnæs <martinal@xxxxxxxxx>:
> On my system, instant currently creates the directory:
>  /tmp/instant
>
> If I run two processes at the same time, or if I and Kent run stuff
> at a server at the same time, this may lead to corrupt data.
>
> Compared to this:
>
> In [5]: tempfile.mkdtemp("instant")
> Out[5]: '/tmp/tmpOFJwuTinstant'
>
> In [6]: tempfile.mkdtemp("instant")
> Out[6]: '/tmp/tmpk9f4xjinstant'
>
> In [7]: tempfile.mkdtemp("instant")
> Out[7]: '/tmp/tmpQ63f-Tinstant'
>
> which gives a unique name each time.
>
> --
> Martin
>
>
> 2008/9/1 Ilmar Wilbers <ilmarw@xxxxxxxxx>:
>> What's wrong with tempfile.gettempdir()? I'm sure that mkdtemp is a better
>> idea, I am just not sure why?
>>
>> ilmar
>>
>> Martin Sandve Alnæs wrote:
>>>
>>> Suggestion: Use 'd = tempfile.mkdtemp("instant")' to create temporary
>>> directory.
>>> This way multiple processes and multiple users can't mess up things.
>>>
>>>
>>
>


Follow ups

References