Return-Path: X-Original-To: apmail-incubator-lucy-user-archive@www.apache.org Delivered-To: apmail-incubator-lucy-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2FA4570F3 for ; Wed, 23 Nov 2011 12:31:45 +0000 (UTC) Received: (qmail 68897 invoked by uid 500); 23 Nov 2011 12:31:45 -0000 Delivered-To: apmail-incubator-lucy-user-archive@incubator.apache.org Received: (qmail 68868 invoked by uid 500); 23 Nov 2011 12:31:45 -0000 Mailing-List: contact lucy-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucy-user@incubator.apache.org Delivered-To: mailing list lucy-user@incubator.apache.org Received: (qmail 68860 invoked by uid 99); 23 Nov 2011 12:31:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Nov 2011 12:31:45 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gorankent@gmail.com designates 209.85.220.175 as permitted sender) Received: from [209.85.220.175] (HELO mail-vx0-f175.google.com) (209.85.220.175) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Nov 2011 12:31:37 +0000 Received: by vcbfo11 with SMTP id fo11so1300378vcb.6 for ; Wed, 23 Nov 2011 04:31:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=BrH/INrNfgvOe1Dcc3i7ylTEecRcILirvfwIS9Ur2vU=; b=WdMLelOx8ImL73cVAciATYi2QycLjOU2Oj1MeX3uvb4s6JyamgMprjPjuco0MDuAun 5qAMeoPDxC4MdmxYlOVMHwcKt9MXIs16C83fgfJqnwCGD47GT2oQJzGv2WtmpAZ/BLt2 BD3GOfnE/J6GrFKkJY6dbrwPYs1End0nSp6VU= MIME-Version: 1.0 Received: by 10.52.89.3 with SMTP id bk3mr24957099vdb.92.1322051476822; Wed, 23 Nov 2011 04:31:16 -0800 (PST) Received: by 10.52.188.10 with HTTP; Wed, 23 Nov 2011 04:31:16 -0800 (PST) In-Reply-To: References: <20111114131516.GA11643@rectangular.com> <20111117232428.GA10555@rectangular.com> <20111118141410.GA5863@rectangular.com> Date: Wed, 23 Nov 2011 14:31:16 +0200 Message-ID: From: goran kent To: lucy-user@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [lucy-user] Concurrent searching On Wed, Nov 23, 2011 at 2:06 PM, goran kent wrote: > What the hell is causing $client_sock->sysread( $buf, 6959) to only > return 2892 bytes!? PERLFUNC(1) for sysread says "*Attempts* to read LENGTH bytes of data..." [emphasis mine] which means there might be unread chunks of bytes. It looks like the 6k client request is being sent as two or more chunks, so sysread needs a loop to get it all: my $ret; do { $ret = $client_sock->sysread( $buf, $len ); last if not $ret; $check_val += $ret; } while $ret; or some such, instead of just $check_val = $client_sock->sysread( $buf, $len ); in SearchServer::serve.