need a non-pickled locmem cache backend
|Reported by:||Owned by:||nobody|
|Component:||Core (Cache system)||Version:||master|
|Severity:||Keywords:||cache, locmem, pickle|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
Rev. 5703 of locmem.py broke some code we have been using. We have a mathematical model consisting of a swig-wrapped C++ object that needs to maintain its state between requests. We initialize the object and store it in the cache, keyed by the user. On each request, we pull the reference to the object and make calculations. Unfortunately, pickling, added in 5703 breaks this code, as our Swig Class is not pickleable. My current workaround has been to remove the pickle.dumps and loads calls wrapping the value to be stored/retrieved. This is not a good long-term solutions. It would be nice to have a sort of "raw" locmem cache that does not attempt to pickle the value as before.