incorrect caching in cache.check_memory_cache

Issue #3 resolved
Prof Garth Wells created an issue

A fix has been committed in http://bazaar.launchpad.net/~instant-core/instant/main/revision/288

Instant was inserting an object into the memory cache even though it was already found in the cache. It was inserting the object based on its address, and not its signature. This meant that a element or form declared in a loop would be repeatedly inserted into the memory cache, despite the signature being the same.

Add tags Tag help Anders Logg (logg) wrote on 2010-02-14: #1 The above fix led to a unit test failing. This is now commented out in tests/test19.py. We need to figure out whether

  1. The bug fix is correct

and/or

  1. The unit test makes sense

Hide comment Changed in instant: importance: Undecided → Medium status: New → Confirmed assignee: nobody → Kent (kent-and) Garth Wells (garth-wells) wrote on 2011-02-23: #2 Has this been fixed?

Hide comment Martin Sandve Alnæs (martinal) wrote on 2012-01-20: #3 The disabled test checks (in an inconvenient way through timing) that .signature() is not called if the signature object (the object with a .signature() function) has already been placed in the memory cache. Since you've disabled placing signature objects in the memory cache, this fails. Since nobody has complained and ufl.Form.signature() caches the repr string itself anyway, this is probably ok. There are probably other places in instant with code designed to handle such object ids in the memory cache, but a cleanup here is a rather high risk operation and it probably doesn't hurt anyone.

Comments (3)

  1. Log in to comment