[ZODB-Dev] Reloading product in 2.8

Shane Hathaway shane at hathawaymix.org
Fri Jul 15 03:15:38 EDT 2005


Tim Peters wrote:
> [Jim Fulton]
>>I agree.  The right way to refresh is to detect code changes (ideally
>>using Linux's brand new inotify mechanism, or something similar when
>>inotify is not available), display a "please wait" message to the user,
>>and restart the process.
> 
> 
> If you're changing more than one file, how could that know when the source
> code is in a globally consistent state again?  (BTW, there are efficient
> ways to get notifications about modified files even on Win95, so that part
> isn't a hangup.)

That problem turns out to be easy for Zope.  The trick is to check for
source code changes at the beginning of web requests, but no more often
than once every two seconds or so.  Developers hack for a while,
producing a set of hopefully consistent changes, then test the new code
just by making a browser request.  Zope's auto-refresh feature works
this way, and I think that part turned out quite successful.

(I just realized there's an important use case: if the developer
introduces an error that prevents the process from restarting, Zope
needs to somehow bring the error to the developer's attention.  The
developer won't necessarily be staring at a terminal.)

Shane


More information about the ZODB-Dev mailing list