Issue Details (XML | Word | Printable)

Key: MODPYTHON-116
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Graham Dumpleton
Reporter: Graham Dumpleton
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
mod_python

Attributes removed from module code file still accessible until restart.

Created: 27/Jan/06 03:16 PM   Updated: 05/Apr/07 11:38 AM
Return to search
Component/s: core
Affects Version/s: 3.1.4, 3.2.7
Fix Version/s: 3.3.1

Time Tracking:
Not Specified

Issue Links:
dependent
 

Resolution Date: 12/Aug/06 08:20 AM


 Description  « Hide
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.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Graham Dumpleton made changes - 10/Mar/06 01:40 PM
Field Original Value New Value
Link This issue depends upon MODPYTHON-143 [ MODPYTHON-143 ]
Graham Dumpleton made changes - 01/Apr/06 01:37 PM
Assignee Graham Dumpleton [ grahamd ]
Graham Dumpleton made changes - 01/Apr/06 01:57 PM
Status Open [ 1 ] In Progress [ 3 ]
Graham Dumpleton made changes - 12/Aug/06 08:20 AM
Fix Version/s 3.3 [ 12310101 ]
Status In Progress [ 3 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Graham Dumpleton made changes - 05/Apr/07 11:38 AM
Status Resolved [ 5 ] Closed [ 6 ]