zodb / relstorage

A backend for ZODB that stores pickles in a relational database.
Other
54 stars 46 forks source link

AttributeError: 'Process' object has no attribute 'memory_full_info' | Mac #393

Closed nazrulworld closed 4 years ago

nazrulworld commented 4 years ago

My Configuration (Plone) Mac OS

rel-storage =
  type postgresql
  dsn dbname='zodb_main' user='zodb' host='127.0.0.1' password='zodb'
  keep-history false
  create-schema true
  blob-dir ${buildout:vardir}/blobstorage
  shared-blob-dir false
  pack-gc true
# Important! do experiment first
  cache-local-mb 100
  cache-local-object-max 16384
  cache-delta-size-limit 100000
# https://relstorage.readthedocs.io/en/latest/relstorage-options.html#persistent-local-caching
  cache-local-dir ${buildout:vardir}/cache
  cache-local-dir-count 20
File "/Users/nazrul/.cache/buildout/eggs/RelStorage-3.0.1-py3.7-macosx-10.15-x86_64.egg/relstorage/cache/mvcc.py", line 954, in restore
    checkpoints = local_client.restore()
  File "/Users/nazrul/.cache/buildout/eggs/RelStorage-3.0.1-py3.7-macosx-10.15-x86_64.egg/relstorage/cache/local_client.py", line 291, in restore
    return self.read_from_sqlite(conn)
  File "/Users/nazrul/.cache/buildout/eggs/RelStorage-3.0.1-py3.7-macosx-10.15-x86_64.egg/relstorage/_util.py", line 233, in f
    result = func(*args, **kwargs)
  File "/Users/nazrul/.cache/buildout/eggs/RelStorage-3.0.1-py3.7-macosx-10.15-x86_64.egg/relstorage/cache/local_client.py", line 505, in read_from_sqlite
    mem_before = get_memory_usage()
  File "/Users/nazrul/.cache/buildout/eggs/RelStorage-3.0.1-py3.7-macosx-10.15-x86_64.egg/relstorage/_util.py", line 332, in get_memory_usage
    proc = get_this_psutil_process()
  File "/Users/nazrul/.cache/buildout/eggs/RelStorage-3.0.1-py3.7-macosx-10.15-x86_64.egg/relstorage/_util.py", line 319, in get_this_psutil_process
    proc.memory_full_info()
AttributeError: 'Process' object has no attribute 'memory_full_info'
jamadden commented 4 years ago

You seem to have a very old version of psutil installed, something older than version 4 (Feb 2016). RelStorage will use psutil if its installed, but if it's installed it needs to be a modern version.

nazrulworld commented 4 years ago

@jamadden you are fully right, I had the older version of psutil, It would be nice if you check psutil version first and warning about the issue.

Other than you can close this issue. Thanks a lot to response to this issue.

gotcha commented 4 years ago

@jamadden psutil is not in the list of dependencies, see https://github.com/zodb/relstorage/blob/master/setup.py#L126

AFAICS, https://github.com/zodb/relstorage/blob/master/src/relstorage/_util.py#L314 makes it a soft dependency.

What is the reason to keep it that way ?

This avoids restricting psutil version.