Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 46685 invoked by uid 500); 11 Nov 2002 22:02:15 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 46617 invoked from network); 11 Nov 2002 22:02:14 -0000 From: "Bill Stoddard" To: , , "APR Development List" Subject: RE: [PATCH] Fix for bug #7617: race condition causes 3 second CGI delay Date: Mon, 11 Nov 2002 16:58:03 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 In-Reply-To: <000901c27879$272ef540$8c27b9d5@soberit.hut.fi> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Kai, Thanks for the patch. I will be committing it later this evening. For future reference APR patches to APR should be posted to dev@apr.apache.org. Thanks again. Bill > > When running my newly installed apache 2.0.40 on my RedHat > 8.0 linux box, I noticed some strange 3-second delays > for clients using keepalives after running CGI scripts > before the next request was processed. > > Some debugging led me to the conclusion that I experienced > the same race-condition as described as #7616 in the bug > database. I.e. after running the CGI script, apache finds > the subprocess to still be active, sends it a SIGINT and > then blocks for three whole seconds before sending a SIGKILL. > Meanwhile, the client using keep-alives is kept waiting > for those three seconds until the next request is processed. > What a waste of time, considering the CGI script actually > exited almost immediately after the SIGINT was sent. > > I confirmed this same behaviour to be present in version 2.0.43, > and saw the need to make a fix to this. Apache 1.3.27 has > very similar code, so the same patch could be easily modified > to work with that version as well! > > Please find enclosed a patch against the 2.0.40 source tree > (should work well on 2.0.43 also) that fixes this unnecessary > delay. The patch makes apache check the status of the subprocesses > in 0.1 second intervals, until either a total of three seconds > have elapsed or all subprocesses have exited. Any subprocesses > still running after 3 seconds are then SIGKILLed as before. > > Hope this quick fix can make it into the official version! > > Best regards, > Kai > > -- > Kai.Risku@arrak.fi Oy Arrak Software Ab > GSM +358-40-767 8282 http://www.arrak.fi >