Return-Path: X-Original-To: apmail-apr-dev-archive@www.apache.org Delivered-To: apmail-apr-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1333D3A94 for ; Fri, 6 May 2011 08:28:53 +0000 (UTC) Received: (qmail 6967 invoked by uid 500); 6 May 2011 08:28:52 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 6893 invoked by uid 500); 6 May 2011 08:28:51 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 6885 invoked by uid 99); 6 May 2011 08:28:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 May 2011 08:28: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 (nike.apache.org: local policy) Received: from [213.160.213.92] (HELO smtp.nedap.com) (213.160.213.92) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 May 2011 08:28:45 +0000 Received: from nvs0066.nedap.local ([10.91.8.1]) by smtp.nedap.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 6 May 2011 10:28:23 +0200 X-TM-IMSS-Message-ID: <1aceef120000bad0@nedap.com> Received: from [10.4.16.108] ([10.4.16.108]) by nedap.com ([10.91.8.1]) with ESMTP (TREND IMSS SMTP Service 7.0) id 1aceef120000bad0 ; Fri, 6 May 2011 10:28:24 +0200 Message-ID: <4DC3B125.8070508@nedap.com> Date: Fri, 06 May 2011 10:28:21 +0200 From: Eric van der Maarel Reply-To: eric.vandermaarel@nedap.com Organization: NEDAP User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Fedora/3.0.10-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.10 MIME-Version: 1.0 To: dev@apr.apache.org Subject: Re: 100% cpu with APR on Windows References: <03230006CA5E1B4D89CCC1DC0BF2209C038A33E416@NVS0192.nedap.local> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 06 May 2011 08:28:23.0247 (UTC) FILETIME=[90319DF0:01CC0BC7] X-Virus-Checked: Checked by ClamAV on apache.org On 05/05/2011 10:17 PM, Jeff Trawick wrote: > On Thu, May 5, 2011 at 3:20 PM, Eric van der Maarel > wrote: >> Hi, >> >> Further investigation reveals a difference between running Tomcat on >> Linux and Windows. From the Tomcat Poller thread the apr_pollset_poll() >> is called. When a client in the pollset has disconnected, under Linux >> this call returns (in the rtnevents member of the descriptors resultset) >> 49 (=0x31, so that would be APR_POLLIN | APR_POLLERR | APR_POLLHUP), >> while under Windows this always return >> 1 (so APR_POLLIN) >> >> The poller in Tomcat reacts on the APR_POLLHUP result, so differently on >> Windows than on Linux. I think the problem lies in the missing >> APR_POLLHUP in the poll return result under Windows (from the >> impl_pollset_poll implemented in select.c by the way). >> >> Anyone any idea why on Windows (select.c) the rtnevents does not have >> the APR_POLLHUP flag up, while on Linux (no idea which poll provider >> version is used ther :-) this flag is set when the client has disconnected? >> And how to fix? :-) > > select() has a simpler view of things; normally something needs to > read from the readable socket, get connreset or equiv, and handle > closed connection at that point > > select() on any platform can't set APR_POLLHUP as a return event > > maybe getsockopt(SOL_SOCKET/SO_ERROR) when socket is readable and > APR_POLLHUP was requested would give the necessary info???? Change the apr client you mean to handle receiving APR_POLLIN, right? > > --/-- > > are you sure select() is being used? newer Windows should have WSApoll()????? Yes, select() is being used (added some logging to select.c that actually shows up). We're running on Windows XP (SP3) which, as I understand it, doesn't have WSAPoll(). If XP does have WSAPoll(), how to enforce it? Is it determined buildtime or runtime which poll/pollset provider is going to be used? Can and should we use another provider than select on XP and how can that be configured? Or, for this use case, shouldn't we use XP altogether and use one of those server versions of Windows instead? Eric -- ------------------------------------------- | Eric van der Maarel | | NEDAP IDEAS | | eric.vandermaarel@nedap.com | -------------------------------------------^[ZZ