[jira] Commented: (MODPYTHON-195) Possible leaking of Win32 event handles when Apache restarted.

2007-05-10 Thread Graham Dumpleton (JIRA)

[ 
https://issues.apache.org/jira/browse/MODPYTHON-195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12494960
 ] 

Graham Dumpleton commented on MODPYTHON-195:


This changes also possibly prevents Apache being run in single process mode on 
Windows when mod_python is loaded. This is because Python will not be 
initialised in the single process and when a request arrives for mod_python it 
will fail.

 Possible leaking of Win32 event handles when Apache restarted.
 --

 Key: MODPYTHON-195
 URL: https://issues.apache.org/jira/browse/MODPYTHON-195
 Project: mod_python
  Issue Type: Bug
  Components: core
Affects Versions: 3.2.10, 3.3.1
Reporter: Graham Dumpleton
 Assigned To: Graham Dumpleton
 Fix For: 3.3.x


 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.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (MODPYTHON-195) Possible leaking of Win32 event handles when Apache restarted.

2006-11-07 Thread Graham Dumpleton (JIRA)
[ 
http://issues.apache.org/jira/browse/MODPYTHON-195?page=comments#action_12447742
 ] 

Graham Dumpleton commented on MODPYTHON-195:


Can you see if you can come up with some check based on values of 'initialized' 
and 'child_init_pool'. First step would be to print out their values amongst 
your above debug.

The 'initialized' flag is in there to work around issues with older Mac OS X 
versions. That used in combination with whether child_init_pool is still zero 
or not, indicating parent or child process, may give you enough to work out 
when to return and not execute the function again.

 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
 Fix For: 3.3


 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




[jira] Commented: (MODPYTHON-195) Possible leaking of Win32 event handles when Apache restarted.

2006-11-06 Thread Jeff Robbins (JIRA)
[ 
http://issues.apache.org/jira/browse/MODPYTHON-195?page=comments#action_12447680
 ] 

Jeff Robbins commented on MODPYTHON-195:



   [[ Old comment, sent from unregistered email on Tue, 24 Oct 2006 06:56:50 
-0400 ]]

I think the problem with a static is that the code gets called in the 
context of the parent process and the child process.   We need some way of 
knowing only to run in the context of the child process.   mpm_winnt.c uses 
AP_PARENT_PID as an environmental only visible to the child process so while 
it is risky in the sense of a dependency, it is how the code that apparently 
produces this problem by creating the windows-specific process architecture 
communicates with itself.



 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




[jira] Commented: (MODPYTHON-195) Possible leaking of Win32 event handles when Apache restarted.

2006-11-06 Thread Jeff Robbins (JIRA)
[ 
http://issues.apache.org/jira/browse/MODPYTHON-195?page=comments#action_12447679
 ] 

Jeff Robbins commented on MODPYTHON-195:



   [[ Old comment, sent from unregistered email on Tue, 24 Oct 2006 06:56:50 
-0400 ]]

I think the problem with a static is that the code gets called in the 
context of the parent process and the child process.   We need some way of 
knowing only to run in the context of the child process.   mpm_winnt.c uses 
AP_PARENT_PID as an environmental only visible to the child process so while 
it is risky in the sense of a dependency, it is how the code that apparently 
produces this problem by creating the windows-specific process architecture 
communicates with itself.



 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




[jira] Commented: (MODPYTHON-195) Possible leaking of Win32 event handles when Apache restarted.

2006-11-06 Thread Jeff Robbins (JIRA)
[ 
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