Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7FD0C6204 for ; Sat, 14 May 2011 20:01:56 +0000 (UTC) Received: (qmail 20729 invoked by uid 500); 14 May 2011 20:01:51 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 20679 invoked by uid 500); 14 May 2011 20:01:51 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 20670 invoked by uid 99); 14 May 2011 20:01:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 May 2011 20:01:51 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of aw@ice-sa.com designates 212.85.38.228 as permitted sender) Received: from [212.85.38.228] (HELO tor.combios.es) (212.85.38.228) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 May 2011 20:01:44 +0000 Received: from [192.168.245.129] (p549E1B51.dip0.t-ipconnect.de [84.158.27.81]) by tor.combios.es (Postfix) with ESMTPA id 8FBBA2260DE for ; Sat, 14 May 2011 22:01:21 +0200 (CEST) Message-ID: <4DCEDF7C.80005@ice-sa.com> Date: Sat, 14 May 2011 22:01:00 +0200 From: =?ISO-8859-1?Q?Andr=E9_Warnier?= Reply-To: Tomcat Users List User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Canceling Download on IIS7 with ISAPI Redirector 1.2.31 causes 100% CPU usage References: <02e901cc1239$acfd77b0$06f86710$@preisser@t-online.de> <4DCE9046.2070901@ice-sa.com> <000301cc1247$7d93adb0$78bb0910$@preisser@t-online.de> In-Reply-To: <000301cc1247$7d93adb0$78bb0910$@preisser@t-online.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit eurotrans-Verlag wrote: > Hi Andr�, thanks for your reply. > >> To figure out if this is what's happening, you could do some logging at >> the servlet end, >> to see if it keeps sending data even when the client has canceled, or >> if it itself gets >> some stop indication from the isapi_redirector (also a closed socket >> e.g.). >> >> Or else Mladen or Rainer could tell us if I'm totally off-base here. > > > I added some logging to the Servlet to see what it is actually doing > (logging the start and end of the doGet() method and every time 2 MB are > written, and I also put the write loop in a try-catch clause to catch > IOException). > > You are right: When I start the download, the servlet writes the bytes > slowly (due to the speed of the Connection) to the output. However, when I > then cancel the download, it writes the remaining bytes very fast, probably > causing the high CPU usage of the ISAPI redirector. > > But in some cases, the result is another: After I canceled the download, the > write() method throws an IOException: > ClientAbortException: java.io.IOException: Failed to send AJP message > > and the remaining bytes are not written, so the CPU usage does not go up to > 100% (That's probably the other case I mentioned before, that sometimes the > CPU usage doesn't go up). > > However I would expect write() to always throw an IOException when the > connection to the client is aborted, Remember, there are 2 separate connections : the connection of the client to IIS+isapi_redirector, and the connection from IIS+isapi_redirector to Tomcat+servlet. The servlet will only throw an I/O exception if that second connection is closed. So it all depends on whether the isapi_redirector closes the connection to Tomcat also, when the client has closed its connection to IIS. but it seems that in most cases, the > IOException is not thrown, thus causing the servlet to write the remaining > bytes very fast to the ISAPI redirector and probably causing the high CPU > load. > Do you or anybody have an idea why sometimes the IOException is not thrown > when the Client aborts the Connection? > I have no idea. We need Mladen or Rainer here.. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org