[ http://issues.apache.org/jira/browse/MODPYTHON-116?page=all ]

Graham Dumpleton resolved MODPYTHON-116.
----------------------------------------

    Fix Version/s: 3.3
       Resolution: Fixed

Resolved by new module importer for 3.3, but for 3.3 release looks like the new 
importer will have to be enabled explicitly as will not be the default.

Note though that in the new module importer, when modules are reloaded they are 
loaded into an empty module object. As a consequence, by default any state held 
as global data in the existing module in memory will be lost. The new importer 
does though allow hooks to be provided for the purpose of transferring state 
from the existing module in memory to the new module when it is being loaded.

> Attributes removed from module code file still accessible until restart.
> ------------------------------------------------------------------------
>
>                 Key: MODPYTHON-116
>                 URL: http://issues.apache.org/jira/browse/MODPYTHON-116
>             Project: mod_python
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.7, 3.1.4
>            Reporter: Graham Dumpleton
>         Assigned To: Graham Dumpleton
>             Fix For: 3.3
>
>
> When using "apache.import_module()" directly, or when it is used indirectly 
> by the "Python*Handler" directives, and automatic module reloading occurs, 
> modules are reloaded on top of the existing module. One of the problems with 
> this is that if an attribute such as a function or data value is removed from 
> the code file on disk, when the module is reloaded, that attribute doesn't 
> get removed from the in memory module held by mod_python. The only way to 
> eliminate such an attributed from the in memory module currently is to 
> restart Apache, automatic module reloading doesn't help.
> A good example of the problems this can cause is with mod_python.publisher. 
> Because attributes can be arbitrarily mapped to by a URL, if you forget to 
> prefix variables or functions with an underscore they will be visible to a 
> request. If such a mistake was realised and you change the source code to add 
> an underscore prefix and relied on automatic module reloading, it wouldn't 
> actually get rid of the incorrectly named attribute in the module held in the 
> mod_python cache. Thus, the restart of Apache is still required.
> As it stands for mod_python.publisher, the problem is fixed in 3.2.6, but it 
> still exists for direct use of "apache.import_module()" and "Python*Handler" 
> directives. The consequences outside of mod_python.publisher may not be as 
> problematic, bu depends on specific user code.
> A scheme whereby new modules are reloaded into a new module instance would 
> eliminate this problem.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to