Bug 8176 - logic error in reclaim_child_processes function called during shutdown
Summary: logic error in reclaim_child_processes function called during shutdown
Alias: None
Product: Apache httpd-1.3
Classification: Unclassified
Component: core (show other bugs)
Version: 1.3.23
Hardware: All Linux
: P3 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Depends on:
Reported: 2002-04-16 21:54 UTC by David Winterbourne
Modified: 2004-11-16 19:05 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description David Winterbourne 2002-04-16 21:54:43 UTC
This function is called at shutdown to kill off all of the children processes 
that were spawned during startup and runtime. The bug is around line 2742 where 
ap_select is called. It seems that the intention was to use the select command 
as a precision sleep mechanism. As the comment indicates, some time needs to be 
allowed for children processes to do their termination stuff. The problem was 
that ap_select was returning prematurely as a result of a signal interupt 
(errno = EINTR), and therefore was never really sleeping for the expected 
amount of time. This didn't allow enough time for my children process to clean 
themselves up and resulted in various resource leaks. I changed the line from:
ap_select(0, NULL, NULL, NULL, &tv);
while(ap_select(0, NULL, NULL, NULL, &tv) == -1) {}
And while I am not saying that this code is the best way to do this, it did 
work, allowing my children to die a natural death.