[Grok-dev] ME GROK RELOAD

Philipp von Weitershausen philipp at weitershausen.de
Mon Jan 29 18:21:56 EST 2007


At the snow sprint I took a first shot at module reload w/o server 
restart: http://mail.zope.org/pipermail/checkins/2007-January/006059.html

There are several issues to be solved yet, especially one with the ZODB. 
It seems that it currently makes the re-import of Persistent subclasses 
impossible because persistent objects seem to cling to the old classes 
instead of the refreshed ones.

Other than that I can report that reload actually works. The algorithm 
that checks for file modification times also seems to be relatively fast 
and shouldn't slow things down too much, especially when the files have 
been recently touched anyway. Hitting the frontpage of grokwiki I 
couldn't measure a significant deviation with and without autorefresh 
enabled.

That brings me to a question: It should be possible to disable 
autorefresh. What would a sensible switch be? Zope3's developer-mode 
(like Zope 2 uses debug-mode)? The problem with that is that it's not 
enabled by default (although we could do that in grok). Note that I 
don't think it makes any sense to allow or disallow the (auto)refresh 
only for specific moduels or packages. Either we dump and reload 
everything that's been grokked, or we don't. Anything else is going to 
cause headaches, e.g. when you have subclasses of refreshed classes 
(they aren't going to see the refreshed classes).

-- 
http://worldcookery.com -- Professional Zope documentation and training
Next Zope 3 training at Camp5: http://trizpug.org/boot-camp/camp5



More information about the Grok-dev mailing list