On Thu, Mar 28, 2013 at 7:13 AM, Ivan <[email protected]> wrote:

>
> Yes, you are right. But I asked for another reason.
> For example, I see, that werkzeug's cache write cache trough temporary
> file
> https://github.com/mitsuhiko/werkzeug/blob/master/werkzeug/contrib/cache.py#L660
> But Django cache do not use neither, tmp file or file locking.
> So, multiple processes can write a file simultaneously. Also, other
> processes can obtain incomplete data.
>
> I think it's a bug, so I asked a question in this group
> (django-developers).
>

Ok - *that* is a different matter. For future reference, if you're
suggesting that something might be a bug, it's helpful to make that clear
in your question.

As I said in my response on django-users, the file based cache is primarily
there as a proof of concept that the caching API can be targeted at
multiple backends. However, if someone were to propose a patch to add file
locking or temp file write-throughs, I don't imagine it would be turned
down.

So - feel free to open a ticket for this; and if you want to try your hand
at a patch, this should be a relatively simple patch to create (although
tests could be a little bit complex). As a helper, the
django.core.files.locks module already contains some OS-abstracted code for
file locking.

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to