[mod_python] [patch] make autoreload more useful

Martin Pool mbp at samba.org
Thu May 30 11:08:15 EST 2002

On 29 May 2002, Dustin Mitchell <dustin at ywlcs.org> wrote:

> And the cost will be zero, if AutoReload is turned off :-)

Yes, that's the nice thing.

> True, but there are valid reasons to want to test and develop such
> opportunistic caching mechanisms (since anything opportunistic is by at least
> a little bit nondeterministic, it probably needs the most testing).

Yes.  You can test them (without changing the code) perfectly well
with this patch.  If you're changing the caching code then by
definition you need to restart one way or another.

Indeed, having objects in memory where the same datastructure is
modified by different versions of the code (with different bugs)
sounds like a recipe for confusion.  Suppose an earlier version of the
cache code actually broke one of the data structure invariants on the
cache -- you *want* to dump and reinitialize the thing.

> BTW: I assume you're not implying that opportunistic caching is overly
> fragile!  It's a great technique!  Relying on not being reloaded, however, is
> obviously stupid, since the Apache API *will* reload you :-)

Yes, that's what I meant: it's only dumb if you *rely* on persistence,
rather than just taking advantage of it when it happens.

Indeed an important part of testing that kind of code would be to set
MaxRequestsPerChild to a low number and make sure that it still works
when it is always being flushed.


Every Python user scoffed at it once, saying significant whitespace is
the past.
	-- Moshe Zadka (?)

More information about the Mod_python mailing list