Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError in the cache when using persistent cache files #140

Closed
jamadden opened this issue Nov 29, 2016 · 0 comments
Closed

AttributeError in the cache when using persistent cache files #140

jamadden opened this issue Nov 29, 2016 · 0 comments
Labels

Comments

@jamadden
Copy link
Member

Given a certain cache pattern that resulted in some rings being overfull, it was possible for the in-memory cache to become corrupted when loading data from disk. The result was an AttributeError like this:

2016-11-28 17:30:57,352 ERROR [ZODB.Connection][139897887425392:12185][MainThread] Couldn't load state for persistent.mapping.PersistentMapping 0x01
Traceback (most recent call last):
  File "//buildout/eggs/ZODB-5.1.1-py2.7.egg/ZODB/Connection.py", line 783, in setstate
    p, serial = self._storage.load(oid)
  File "//buildout/eggs/zc.zlibstorage-1.1.0-py2.7.egg/zc/zlibstorage/__init__.py", line 59, in load
    data, serial = self.base.load(oid, version)
  File "//buildout/eggs/perfmetrics-2.0-py2.7.egg/perfmetrics/__init__.py", line 127, in call_with_metric
    return f(*args, **kw)
  File "//buildout/eggs/RelStorage-2.0.0b8-py2.7-linux-x86_64.egg/relstorage/storage.py", line 566, in load
    state, tid_int = cache.load(cursor, oid_int)
  File "//buildout/eggs/RelStorage-2.0.0b8-py2.7-linux-x86_64.egg/relstorage/cache/storage_cache.py", line 451, in load
    response = client.get_multi(cachekeys)
  File "//buildout/eggs/RelStorage-2.0.0b8-py2.7-linux-x86_64.egg/relstorage/cache/local_client.py", line 139, in get_multi
    res = get(keys)
  File "//buildout/eggs/RelStorage-2.0.0b8-py2.7-linux-x86_64.egg/relstorage/cache/mapping.py", line 195, in get_and_bubble_all
    gens[entry.cffi_entry.r_parent].on_hit(entry)
AttributeError: 'NoneType' object has no attribute 'on_hit'
@jamadden jamadden added the bug label Nov 29, 2016
jamadden added a commit that referenced this issue Nov 29, 2016
…des.

This only happened when the cache entries were sized in such a way that
when a new entry could fit we would still like to reject an old entry
from a different ring.

Fixes #140.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant