Bug 55698 - Apache 2.2 + mod_fcgid 2.3.7 (CentOS 6.4) graceful restarts, no leftover processes, but errors both in browser and error log
Summary: Apache 2.2 + mod_fcgid 2.3.7 (CentOS 6.4) graceful restarts, no leftover proc...
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_fcgid (show other bugs)
Version: 2.2-HEAD
Hardware: PC Linux
: P2 major (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Keywords: MassUpdate
Depends on:
Reported: 2013-10-24 10:12 UTC by Georgi Petrov
Modified: 2018-11-07 21:10 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Georgi Petrov 2013-10-24 10:12:14 UTC
Upon graceful restart the CGI processes get forcefully killed before they end and you don't get the output to the browser.

What is the setup:

CentOS 6.4 x86_64 minimal installation
mod_fcgid.x86_64 2.3.7-1.el6 
httpd.x86_64 1:2.2.15-29.el6.vm.1
php.x86_64 5.3.3-23.el6_4

Single virtual domain, running under mod_fcgid execution mode, with 90 sec PHP execution time and fcgid IO wait.

Single test.php file containing (just sleep loop):

for($i = 1; $i <= 30; $i++) {
    echo $i."\n";
    file_put_contents("test.txt", "test run for: ".$i." seconds");

What is the error:

Run the script via browser, then go and do a graceful restart on Apache (service httpd graceful). After around 12 seconds you are going to see "No data received" error in you browser (Chrome) and the following in the Apache error log:

(22)Invalid argument: mod_fcgid: can't lock process table in pid [some_pid]

Examining test.txt shows that this script gets forcefully killed before ending.

If you reduce the time the script executes to 5 seconds ($i <= 4), you'll get the same result, this time after 5 seconds.

Examining test.txt shows this process completes, but you still get the errors both in the browser and the error log.

So why 12 seconds and where is this set. After some time I discovered that increasing FcgidErrorScanInterval to 60 will let the process with 30 sec loop to complete (but still you get the errors).

The error in the log "can't lock process table in pid..." probably means that some information about the process is destroyed immediately upon the graceful restart (I assume it is something with the mutex).

Even if we get around the early termination of the processes increasing FcgidErrorScanInterval the second problem is actually bigger - the script output never gets back.
Comment 1 Thomas Gross 2014-08-13 04:39:07 UTC
Has there been any progress on this?
Comment 2 William A. Rowe Jr. 2018-11-07 21:10:02 UTC
Please help us to refine our list of open and current defects; this is a mass update of old and inactive Bugzilla reports which reflect user error, already resolved defects, and still-existing defects in httpd.

As repeatedly announced, the Apache HTTP Server Project has discontinued all development and patch review of the 2.2.x series of releases. The final release 2.2.34 was published in July 2017, and no further evaluation of bug reports or security risks will be considered or published for 2.2.x releases. All reports older than 2.4.x have been updated to status RESOLVED/LATER; no further action is expected unless the report still applies to a current version of httpd.

If your report represented a question or confusion about how to use an httpd feature, an unexpected server behavior, problems building or installing httpd, or working with an external component (a third party module, browser etc.) we ask you to start by bringing your question to the User Support and Discussion mailing list, see [https://httpd.apache.org/lists.html#http-users] for details. Include a link to this Bugzilla report for completeness with your question.

If your report was clearly a defect in httpd or a feature request, we ask that you retest using a modern httpd release (2.4.33 or later) released in the past year. If it can be reproduced, please reopen this bug and change the Version field above to the httpd version you have reconfirmed with.

Your help in identifying defects or enhancements still applicable to the current httpd server software release is greatly appreciated.