plone / plone.recipe.zope2instance

zc.buildout recipe to setup and configure a Zope 2 instance.
https://pypi.org/project/plone.recipe.zope2instance
7 stars 23 forks source link

Persistent cache not honoring location set via TMP environment variable #30

Closed hvelarde closed 5 years ago

hvelarde commented 7 years ago

I noticed that the ZEO persistent cache files are always being stored in the location specified by the var directive differing from what the documentation says:

zeo-client-cache-size Set the size of the ZEO client cache. Defaults to ‘128MB’. The ZEO cache is a disk based cache shared between application threads. It’s stored inside the directory designated by the TMP environment variable. zeo-client-client Set the persistent cache name that is used to construct the cache filenames. This enabled the ZEO cache to be persisted. Persistent cache files are disabled by default.

In my case, this is what I have in my zope.etc:

...
TMP /tmp
...
# Blob-enabled ZEOStorage database
    <zeoclient>
      read-only false
      read-only-fallback on
      blob-dir /opt/plone/buildout/var/blobcache
      shared-blob-dir no
      server 10.136.23.73:8100
      server 10.136.17.49:8100
      storage 1
      name zeostorage
      var /opt/plone/buildout/parts/instance1/var
      cache-size 256MB
      client zeoclient
    </zeoclient>
    mount-point /
</zodb_db>

The ZEO persistent cache file is always stored in /opt/plone/buildout/parts/instance1/var so I lost it every time I run buildout.

rafaelbco commented 6 years ago

@hvelarde: As a workaround you can use the zeo-var option of the recipe. Set it to a directory outside /parts so it won't be deleted when you run buildout.

I'm using zeo-var = $CLIENTHOME and it's working. The .zec and related files end up in ${buildout:directory}/var/instance and are not deleted when buildout runs.