• Julien Muchembled's avatar
    client: fix item eviction from cache, which could break loading from storage · 4ef05b9e
    Julien Muchembled authored
    `ClientCache._oid_dict` shall not have empty values. For a given oid, when the
    last item is removed from the cache, the oid must be removed as well to free
    memory. In some cases, this was not done.
    
    A consequence of this bug is the following exception:
    
        ERROR ZODB.Connection Couldn't load state for 0x02d1e1e4
        Traceback (most recent call last):
          File "ZODB/Connection.py", line 860, in setstate
            self._setstate(obj)
          File "ZODB/Connection.py", line 901, in _setstate
            p, serial = self._storage.load(obj._p_oid, '')
          File "neo/client/Storage.py", line 82, in load
            return self.app.load(oid)[:2]
          File "neo/client/app.py", line 358, in load
            self._cache.store(oid, data, tid, next_tid)
          File "neo/client/cache.py", line 228, in store
            prev = item_list[-1]
        IndexError: list index out of range
    4ef05b9e
cache.py 11.8 KB