collective / sauna.reload

Instant code reloading for Plone using a fork loop.
http://pypi.python.org/pypi/sauna.reload/
Other
11 stars 5 forks source link

Any chances of getting sauna.reload to work with RelStorage? #12

Closed neilferreira closed 9 years ago

neilferreira commented 11 years ago

Hello,

Currently a known limitation of sauna.reload is that it only works wiht FileStorage, I would really like to be using it with RelStorage. If I try it this error comes up:

2013-08-27 10:34:50 INFO sauna.reload.parent We saved at least 9.79529190063 seconds from boot up time 2013-08-27 10:34:50 INFO sauna.reload.parent Overview available at http://127.0.0.1:8080/@@saunareload Traceback (most recent call last): .... File "/home/neilf/.buildout/eggs/ZODB3-3.10.5-py2.7-linux-x86_64.egg/ZODB/Connection.py", line 1075, in _release_resources c._storage.release() AttributeError: 'NoneType' object has no attribute 'release'

Is this a limitation that will ever be resolved?

datakurre commented 11 years ago

Hi, have you tried with ZEO-setup yet? (With sauna.reload configured for zeo-client.)

Also, could you give a full traceback?

neilferreira commented 10 years ago

Just got back to this again on a new website.

I will look into ZEO setup.

Full traceback: neilf@Ubuntu-iMac:~/development/website/website-website.wa.gov.au-v2$ RELOAD_PATH=src/ bin/instance fg 2014-06-17 13:45:27 INFO ZServer HTTP server started at Tue Jun 17 13:45:27 2014 Hostname: 0.0.0.0 Port: 8080

2014-06-17 13:45:31 WARNING Init Class plone.app.drafts.storage.Storage has a security declaration for nonexistent method 'drafts' 2014-06-17 13:45:31 INFO Zope Ready to handle requests 2014-06-17 13:45:31 INFO sauna.reload.parent Starting file monitor on /home/neilf/development/website/website-website.wa.gov.au-v2/src 2014-06-17 13:45:31 INFO sauna.reload.parent We saved at least 4.30468416214 seconds from boot up time 2014-06-17 13:45:31 INFO sauna.reload.parent Overview available at http://127.0.0.1:8080/@@saunareload Traceback (most recent call last): File "/home/neilf/development/website/website-website.wa.gov.au-v2/parts/instance/bin/interpreter", line 328, in exec(compile(filef.read(), file, "exec")) File "/home/neilf/development/website/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/run.py", line 76, in run() File "/home/neilf/development/website/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/run.py", line 24, in run starter.shutdown() File "/home/neilf/development/website/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/init.py", line 113, in shutdown db.close() File "/home/neilf/development/website/buildout-cache/eggs/ZODB3-3.10.5-py2.7-linux-x86_64.egg/ZODB/DB.py", line 624, in close @self._connectionMap File "/home/neilf/development/website/buildout-cache/eggs/ZODB3-3.10.5-py2.7-linux-x86_64.egg/ZODB/DB.py", line 506, in _connectionMap self.pool.map(f) File "/home/neilf/development/website/buildout-cache/eggs/ZODB3-3.10.5-py2.7-linux-x86_64.egg/ZODB/DB.py", line 206, in map self.all.map(f) File "/home/neilf/development/website/buildout-cache/eggs/transaction-1.1.1-py2.7.egg/transaction/weakset.py", line 58, in map f(elt) File "/home/neilf/development/website/buildout-cache/eggs/ZODB3-3.10.5-py2.7-linux-x8664.egg/ZODB/DB.py", line 628, in c._release_resources() File "/home/neilf/development/website/buildout-cache/eggs/ZODB3-3.10.5-py2.7-linux-x86_64.egg/ZODB/Connection.py", line 1075, in _release_resources c._storage.release() AttributeError: 'NoneType' object has no attribute 'release'

datakurre commented 10 years ago

And your ZEO-configuration works just normally without sauna.reload?

I'm puzzled by the traceback, because there's no mention about anything relating to sauna.reload with that error. And it does not monkeypatch anything in ZODB or ZEO.

neilferreira commented 10 years ago

More tracebacks, take note of the ^C when I shut down the server WITHOUT setting the RELOAD_PATH

(reverse-i-search)`': RELOAD_PATH=src/ bin/instance fg^C neilf@Ubuntu-iMac:~/development/website/website-website.wa.gov.au-v2$ bin/instance fg 2014-06-17 14:15:10 INFO ZServer HTTP server started at Tue Jun 17 14:15:10 2014 Hostname: 0.0.0.0 Port: 8080 2014-06-17 14:15:14 WARNING Init Class plone.app.drafts.storage.Storage has a security declaration for nonexistent method 'drafts' 2014-06-17 14:15:14 INFO Zope Ready to handle requests

sauna.reload: No paths in RELOAD_PATH environment variable. Not starting fork loop. Set it to your development egg paths to activate reloading

Example: $ RELOAD_PATH=src/ bin/instance fg

^C2014-06-17 14:15:21 INFO SignalHandler Caught signal SIGINT 2014-06-17 14:15:21 INFO Z2 Shutting down Traceback (most recent call last): File "/home/neilf/development/website/website-website.wa.gov.au-v2/parts/instance/bin/interpreter", line 328, in exec(compile(filef.read(), file, "exec")) File "/home/neilf/development/website/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/run.py", line 76, in run() File "/home/neilf/development/website/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/run.py", line 26, in run starter.run() File "/home/neilf/development/website/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/init.py", line 108, in run self.shutdown() File "/home/neilf/development/website/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/init.py", line 113, in shutdown db.close() File "/home/neilf/development/website/buildout-cache/eggs/ZODB3-3.10.5-py2.7-linux-x86_64.egg/ZODB/DB.py", line 624, in close @self._connectionMap File "/home/neilf/development/website/buildout-cache/eggs/ZODB3-3.10.5-py2.7-linux-x86_64.egg/ZODB/DB.py", line 506, in _connectionMap self.pool.map(f) File "/home/neilf/development/website/buildout-cache/eggs/ZODB3-3.10.5-py2.7-linux-x86_64.egg/ZODB/DB.py", line 206, in map self.all.map(f) File "/home/neilf/development/website/buildout-cache/eggs/transaction-1.1.1-py2.7.egg/transaction/weakset.py", line 58, in map f(elt) File "/home/neilf/development/website/buildout-cache/eggs/ZODB3-3.10.5-py2.7-linux-x8664.egg/ZODB/DB.py", line 628, in c._release_resources() File "/home/neilf/development/website/buildout-cache/eggs/ZODB3-3.10.5-py2.7-linux-x86_64.egg/ZODB/Connection.py", line 1075, in _release_resources c._storage.release() AttributeError: 'NoneType' object has no attribute 'release'

neilf@Ubuntu-iMac:~/development/website/website-website.wa.gov.au-v2$ RELOAD_PATH=src/ bin/instance fg 2014-06-17 14:15:25 INFO ZServer HTTP server started at Tue Jun 17 14:15:25 2014 Hostname: 0.0.0.0 Port: 8080 2014-06-17 14:15:28 WARNING Init Class plone.app.drafts.storage.Storage has a security declaration for nonexistent method 'drafts' 2014-06-17 14:15:29 INFO Zope Ready to handle requests 2014-06-17 14:15:29 INFO sauna.reload.parent Starting file monitor on /home/neilf/development/website/website-website.wa.gov.au-v2/src 2014-06-17 14:15:29 INFO sauna.reload.parent We saved at least 4.36768603325 seconds from boot up time 2014-06-17 14:15:29 INFO sauna.reload.parent Overview available at http://127.0.0.1:8080/@@saunareload Traceback (most recent call last): File "/home/neilf/development/website/website-website.wa.gov.au-v2/parts/instance/bin/interpreter", line 328, in exec(compile(filef.read(), file, "exec")) File "/home/neilf/development/website/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/run.py", line 76, in run() File "/home/neilf/development/website/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/run.py", line 24, in run starter.shutdown() File "/home/neilf/development/website/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/init.py", line 113, in shutdown db.close() File "/home/neilf/development/website/buildout-cache/eggs/ZODB3-3.10.5-py2.7-linux-x86_64.egg/ZODB/DB.py", line 624, in close @self._connectionMap File "/home/neilf/development/website/buildout-cache/eggs/ZODB3-3.10.5-py2.7-linux-x86_64.egg/ZODB/DB.py", line 506, in _connectionMap self.pool.map(f) File "/home/neilf/development/website/buildout-cache/eggs/ZODB3-3.10.5-py2.7-linux-x86_64.egg/ZODB/DB.py", line 206, in map self.all.map(f) File "/home/neilf/development/website/buildout-cache/eggs/transaction-1.1.1-py2.7.egg/transaction/weakset.py", line 58, in map f(elt) File "/home/neilf/development/website/buildout-cache/eggs/ZODB3-3.10.5-py2.7-linux-x8664.egg/ZODB/DB.py", line 628, in c._release_resources() File "/home/neilf/development/website/buildout-cache/eggs/ZODB3-3.10.5-py2.7-linux-x86_64.egg/ZODB/Connection.py", line 1075, in _release_resources c._storage.release() AttributeError: 'NoneType' object has no attribute 'release' neilf@Ubuntu-iMac:~/development/website/website-website.wa.gov.au-v2$

neilferreira commented 10 years ago

Hmmm, stay tuned. I think you're right, this may mostly have nothing todo with Sauna. I uninstalled sauna and get the same issue when CTRL + C'ing the insance.

[instance] <= instance_base recipe = plone.recipe.zope2instance http-address = 8080 ; zope-conf-additional = %import sauna.reload rel-storage = blob-dir ${buildout:var-dir}/blobstorage dsn dbname = ${buildout:database-name} host=${buildout:database-host} user=${buildout:database-user}

neilferreira commented 10 years ago

ok, this problem appears to be with relstorage rather than being with sauna. I will chase it up with them :)

Sorry guys!

datakurre commented 10 years ago

Ok. Check-in again, when you get relstorage working and can either confirm sauna.reload to work with it (via ZEO) or get sauna-related error :)