[mod_python] [Vampire] Module partially loaded?

Stephane Bortzmeyer bortzmeyer at nic.fr
Thu Jun 30 17:52:13 EDT 2005


I have a Python module which defines several functions and also
includes a bit a code is executed when the module is imported:

do_something()

def function1():
   ...

If do_something() fails (it connects to a database and the database
server may be down), the rest of the module is not executed, function1
is not defined but the module stays loaded: further requests just get
a message that there is no function1 defined.

Restarting Apache is the only solution to get rid of the partly loaded
module.

It seems a bug to me: if the module cannot be fully loaded because the
initialization code fails, the module should not be loaded at all, so
that further attempts have a chance to succeed. 

Apache 2.0.54, mod_python 3.1.3, Vampire 1.7


More information about the Mod_python mailing list