03-11-06 01:45 AM
[ http://issues.apache.org/jira/brows...ON-117?page=all ]
Graham Dumpleton reassigned MODPYTHON-117:
------------------------------------------
Assign To: Graham Dumpleton
> PythonImport that works for any interpreter.
> --------------------------------------------
>
> Key: MODPYTHON-117
> URL: http://issues.apache.org/jira/browse/MODPYTHON-117
> Project: mod_python
> Type: Wish
> Components: core
> Versions: 3.2.7
> Reporter: Graham Dumpleton
> Assignee: Graham Dumpleton
>
> Currently PythonImport requires that the name of the interpreter be explicitly nam
ed. If running lots of virtual hosts, where each is dynamically assigned their own i
nterpreter name automatically, it is a lot of work to have to specify PythonImport d
ire
ctives for all virtual host interpreters where a particular module needs to be loaded in all
interpreters.
> Syntactically, it isn't hard to allow something like:
> PythonImport moduleforallinterpreters
> or:
> PythonImport moduleforallinterpreters *
> however the current location where such Python imports are done in mod_pyt
hon will not allow this.
> This is because such Python imports are done in the PythonChildInitHandler() funct
ion right after the child process is initialised. The code iterates through the list
of imports and creates interpreters for the named interpreters and loads the module
s.
Where we want a module loaded into all modules, we will not actually know the names of all p
otential modules in advance at that point so can't do it.
> The logical spot is to to load a module common to all modules in get_inter
preter() when a request is first made for the interpreter. Thus, it may be p
ossible to move the module imports from PythonChildInitHandler() into get_in
terpreter().
> One issue that needs to be considered is that currently, having a PythonImport dir
ective means that any named interpreter is always created at child initialisation, e
ven if a request never arrives that is processed within the context of that interpre
ter
. It might also be worthwhile adding syntax which allows one to specify whet
her a PythonImport should be performed at the point of child initialisation,
or only when a request comes in that requires that specific interpreter. To
keep backward compatabilit
y, the default would be at child initialisation time.
> Not sure what would be a good syntax. The options would be 'child intialisation' a
nd 'interpreter initialisation'. How to express that????
[ Post a follow-up to this message ]
|