Bug 54118 - Handle leak on parent httpd process when rotatelogs is used with CustomLog directive
Summary: Handle leak on parent httpd process when rotatelogs is used with CustomLog di...
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.4.3
Hardware: PC All
: P2 normal with 1 vote (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-08 09:37 UTC by Albin Carpentier
Modified: 2012-11-08 09:42 UTC (History)
0 users



Attachments
apache conf file (19.51 KB, application/octet-stream)
2012-11-08 09:37 UTC, Albin Carpentier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Albin Carpentier 2012-11-08 09:37:35 UTC
Created attachment 29570 [details]
apache conf file

With apache 2.4.3 Win32 (Apache Lounge Distribution, Apache 2.4.3 win32, IPv6 and Crypto enabled, apr-1.4.6 apr-util-1.4.1 apr-iconv-1.2.1 openssl-1.0.1c zlib-1.2.7 pcre-8.30 libxml2-2.7.8 lua-5.1.5 expat 2.1.0).

The leak on the parent process appear when the child httpd process is recycled, so configure mpm_winnt_module with MaxConnectionsPerChild = 100:
<IfModule mpm_winnt_module>
    ThreadsPerChild         150
    MaxConnectionsPerChild  100
</IfModule>

In httpd.conf, configure ErrorLog and CustomLog to use rotatelogs program:
ErrorLog "| bin/rotatelogs.exe logs/error.%Y-%m-%d.log 86400"
CustomLog "| bin/rotatelogs.exe logs/access.%Y-%m-%d.log 86400" common

Start apache
Using "handle" program from sysinternal, execute "handle -s -p <httpd parent pid>"
In apache/bin directory, execute "ab.exe -n 100 http://localhost/"
Rexecute "handle -s -p <httpd parent pid>"
Compare the 2 results:
  - in the first I have: "22C: Process       rotatelogs.exe(7956)"
  - in the second I have: "22C: Process       <Non-existant Process>(7956)"

And to confirm it's due to rotatelogs used with CustomLog, comment the "CustomLog" line in httpd.conf and retry => no handle leak on the parent httpd process.