Subject: [Instant-dev] Lock files

From: Ilmar Wilbers <[email-masked]>
Date: Fri, 24 Apr 2009 14:58:42 +0200

I noticed that the .lock files not always are written to the Instant 
cache, but are found in the same location as the cache_dir argument, 
although the module in fact does not end up there. Particularely when 
using the argument modulename, the .lock file ends up in the directory 
specified by cache_dir although the module directory ends up in pwd. Is 
this behaviour intended?

When importing a module by the module name, we get an error if we don't 
have write access to the directory in cache_dir:
m = instant.import_module('instant_ext', '/usr')
IOError: [Errno 13] Permission denied: '/usr/instant_ext.lock'

I'm not saying this isn't right, I just wondered if this is the way it 
should be.

ilmar

---

From: Martin Sandve Alnæs <[email-masked]>
Date: Fri, 24 Apr 2009 15:33:07 +0200

> specified by cache_dir although the module directory ends up in pwd. Is

The modulename is intended for placing the module outside the cache
in a fixed directory. So the lock file should then be placed somewhere else,
since we don't know if the user can access the cache directory.
Either we don't need lock files for manually specified module directories,
or it should be placed locally, i.e. in pwd.

> I'm not saying this isn't right, I just wondered if this is the way it

Why would you want to specify a cache_dir you can't write to? I say that's ok.

Martin

---

From: Ilmar Wilbers <[email-masked]>
Date: Fri, 24 Apr 2009 16:21:13 +0200

> or it should be placed locally, i.e. in pwd.
I don't sse a situation where one would need locking outside the cache, 
so I suggest we 1) disable locking files for modulename != None. 
Alternatively, we 2) place the lock file in the cwd just as the module 
directory.

Any objections against 1)?

ilmar

---

From: Martin Sandve Alnæs <[email-masked]>
Date: Sat, 25 Apr 2009 11:48:08 +0200

On Fri, Apr 24, 2009 at 4:21 PM, Ilmar Wilbers <[email-masked]> wrote:
> I don't sse a situation where one would need locking outside the cache, so I
> suggest we 1) disable locking files for modulename != None. Alternatively,
> we 2) place the lock file in the cwd just as the module directory.
>
>

Go for (1), if the user requests manual control it's ok that instant
doesn't handle the locking.

Martin