[ 
http://issues.apache.org/jira/browse/MODPYTHON-195?page=comments#action_12447681
 ] 
            
Jeff Robbins commented on MODPYTHON-195:
----------------------------------------


   [[ Old comment, sent from unregistered email on Tue, 24 Oct 2006 09:13:26 
-0400 ]]

Graham,

I added a printout after the call to apr_pool_user_data_get.  What I think 
is happening is that the hook python_init() is called "again" in the parent 
process (so data is already 1) and then called the expected 2 times in the 
child process (wherein the usual protection works and the bulk of 
python_init() only runs through on the second time in.  The problem is that 
the parent process on windows is long-lived and is just there to spin up and 
down the child process that does the real web serving.  It is the parent 
process run through python_init() that needs to be defeated, and the usual 
protection does no good there.

code in mod_python.c:
rc = apr_pool_userdata_get(&data, userdata_key, s->process->pool);
// JSR
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, s, "python_init: 
apr_pool_userdata_get() rc=%d data=%x", rc, data);

error log fragment: (with my comments added):
[Tue Oct 24 09:04:41 2006] [notice] Parent: Received restart signal --  
Restarting the server.
[Tue Oct 24 09:04:41 2006] [notice] Child 1952: Exit event signaled. Child 
process is ending.
[Tue Oct 24 09:04:41 2006] [error] python_init: apr_pool_userdata_get() rc=0 
data=1 // this is the call in the parent process that we need to skip
[Tue Oct 24 09:04:41 2006] [notice] Parent: Created child process 9688
[Tue Oct 24 09:04:41 2006] [error] python_init: apr_pool_userdata_get() rc=0 
data=0 // these are the two calls in the new child process
[Tue Oct 24 09:04:41 2006] [error] python_init: apr_pool_userdata_get() rc=0 
data=1
[Tue Oct 24 09:04:41 2006] [notice] mod_python: Creating 8 session mutexes 
based on 0 max processes and 50 max threads.
[Tue Oct 24 09:04:41 2006] [notice] Child 9688: Child process is running
[Tue Oct 24 09:04:42 2006] [notice] Child 1952: Released the start mutex
[Tue Oct 24 09:04:42 2006] [notice] Child 9688: Acquired the start mutex.
[Tue Oct 24 09:04:42 2006] [notice] Child 9688: Starting 50 worker threads.

Given the long-lived nature of the parent process, I'm beginning to think 
that your idea of a static might be better than checking for the 
environmental.

- Jeff



> Possible leaking of Win32 event handles when Apache restarted.
> --------------------------------------------------------------
>
>                 Key: MODPYTHON-195
>                 URL: http://issues.apache.org/jira/browse/MODPYTHON-195
>             Project: mod_python
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.10
>            Reporter: Graham Dumpleton
>
> Jeff Robins in:
>   
> http://mail-archives.apache.org/mod_mbox/httpd-python-dev/200610.mbox/[EMAIL 
> PROTECTED]
> indicates a belief that when an Apache restart is performed on Windows that 
> there are a number of Win32 event handles leaked. His belief is that this 
> seems to be linked to mod_python.

-- 
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