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 032F7460C for ; Fri, 27 May 2011 08:31:25 +0000 (UTC) Received: (qmail 3427 invoked by uid 500); 27 May 2011 08:31:24 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 3224 invoked by uid 500); 27 May 2011 08:31:23 -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 3209 invoked by uid 99); 27 May 2011 08:31:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 May 2011 08:31:22 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of justin.erenkrantz@gmail.com designates 74.125.82.42 as permitted sender) Received: from [74.125.82.42] (HELO mail-ww0-f42.google.com) (74.125.82.42) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 May 2011 08:31:15 +0000 Received: by wwk4 with SMTP id 4so5181928wwk.1 for ; Fri, 27 May 2011 01:30:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=LSl1HsZovxhJ3RjB7asvayAaO9FpayMjsaLM4rQ2UAM=; b=fjrmppTo/D8U52ZXc8SVEubUzTnN5/rBr4ZvKrpm5knVcvnOyKuU+ZtG9YRFjDwihe pjavKKFnC5vS/SdpNq6Ng6sw34aHUtcUAX34yCM2sIrtXmlE1q4fKarfChVrETlGcQDc ySz9VhQdsNT8skYw4MieRwjjWch1hlVdNyBe8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=Ou9TyPocA4ei9JEFzKDlwEonyN1Ngd6ZvX9+o5+Dtj1rD27oCBM/mpdcmo/IBxBl8g hgZpTJoV+zePtO9AFCz4t4tS6m6nvYW9L0Q6xB1GfNUputzr7YqN7hj4DxUC/C/Q+agc Aeu9CdsjuVCGaCo6cGuTSQ54jUE9Aasnp2Lqo= MIME-Version: 1.0 Received: by 10.216.143.7 with SMTP id k7mr1687761wej.95.1306485054242; Fri, 27 May 2011 01:30:54 -0700 (PDT) Sender: justin.erenkrantz@gmail.com Received: by 10.216.3.135 with HTTP; Fri, 27 May 2011 01:30:54 -0700 (PDT) In-Reply-To: References: <03230006CA5E1B4D89CCC1DC0BF2209C038A33E416@NVS0192.nedap.local> <4DC3B125.8070508@nedap.com> Date: Thu, 26 May 2011 22:30:54 -1000 X-Google-Sender-Auth: XBfCki2qvpPahwA83wlZEvfde10 Message-ID: Subject: Re: 100% cpu with APR on Windows From: Justin Erenkrantz To: Jeff Trawick Cc: dev@apr.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, May 6, 2011 at 4:01 AM, Jeff Trawick wrote: > WSAPoll() is available with Vista/2008 Server and later. =A0It should be > used automatically by APR without rebuilding your code (via a run-time > check for presence of the Windows API). > > As far as WSAPoll() and this issue... =A0MS doc says > > "POLLHUP =A0 =A0 =A0 =A0A stream-oriented connection was either disconnec= ted or aborted." > > POLLHUP is mapped to APR_POLLHUP. > > (IOW, I didn't test but it looks promising.) FWIW, serf is running into a similar issue when a connection is made to a server on a non-existent port. (The Subversion folks have marked this as a blocking bug for 1.7.x.) It looks like WSAPoll() may not work properly with non-blocking connect() calls: http://social.msdn.microsoft.com/Forums/en/wsk/thread/18769abd-fca0-4d3c-98= 84-1a38ce27ae90 The apr_pollset_poll call never indicates a failure (so it only returns after the timeout expires and says nothing interesting happened). Reading the connect() docs, it appears that you have to call select() - not WSAPoll() - to figure out the status of the connect() call: http://msdn.microsoft.com/en-us/library/ms737625(v=3DVS.85).aspx Has anyone else seen this behavior? Anybody have any clever workarounds? -- justin