From dev-return-33427-apmail-directory-dev-archive=directory.apache.org@directory.apache.org Sun May 16 23:48:46 2010 Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 41537 invoked from network); 16 May 2010 23:48:46 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 May 2010 23:48:46 -0000 Received: (qmail 64861 invoked by uid 500); 16 May 2010 23:48:46 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 64831 invoked by uid 500); 16 May 2010 23:48:46 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 64824 invoked by uid 99); 16 May 2010 23:48:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 May 2010 23:48:46 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of elecharny@gmail.com designates 74.125.82.178 as permitted sender) Received: from [74.125.82.178] (HELO mail-wy0-f178.google.com) (74.125.82.178) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 May 2010 23:48:38 +0000 Received: by wyj26 with SMTP id 26so1560067wyj.37 for ; Sun, 16 May 2010 16:48:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=T8fPZmmWVZHd2lEDC4+Du2LmfAu0PhBmMp9f6aVhlbA=; b=h8R5G5zxDG6qNKN/VDCMdxIsMdLytndpjMYZacOd5wn3k+UEG/XvaPHHhm5wf5J5sR TAz3rBDc5xw48rD3KdL0tY4657pE6FlepQ+dUtBw4imQMMOzqnVgGWQKfqacMQdiOOmX 0so3fGOHhSoaErswp5eCanbIIrjoDdGIq5xd0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=sGK5nTcw87tZKBSlIezfLWx/UGY7esgHFoGJvLPtmqGRkHqkWj5wzIsw1U/LRhTbdA nRM3ykTrg48y/9LE+rwhl8nCmuFNWyhc2gQF0LGpqZKrnLiRJjl1vH9BJUWB+5xEeGUx Q/MjCrUM2NItxxOwl8GC+fYbythhX4BWBLQ9E= Received: by 10.227.155.75 with SMTP id r11mr4113763wbw.62.1274053697821; Sun, 16 May 2010 16:48:17 -0700 (PDT) Received: from emmanuel-lecharnys-MacBook-Pro.local (vol75-3-82-66-216-176.fbx.proxad.net [82.66.216.176]) by mx.google.com with ESMTPS id h22sm12935228wbh.9.2010.05.16.16.48.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 16 May 2010 16:48:17 -0700 (PDT) Message-ID: <4BF08445.50504@gmail.com> Date: Mon, 17 May 2010 01:48:21 +0200 From: Emmanuel Lecharny Reply-To: elecharny@apache.org User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: Apache Directory Developers List Subject: Paged Search issues Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Hi guys, as everyone who build the server from time to time knows, we have random errors in PagedSearch tests. Stefan spent some time to see what's going on, and I must admit I was lazzy enough to accept the idea that we have errors in this area, until I move my butt to fix it. So I checked the code, and I found a couple of major errors in this code (and as I wrote it, I'm responsible for this) : - first, I wrongly assumed that the cookie would be 4 bytes long, as it was stored in an int on the server. Nothing could be more wrong, as an int BER encoded can be from 1 to 4 bytes. We had situation where, when the cookie was encoded on 3 bytes only, we had an internal AIOOBE. I fixed that. - second, the cookie was computed based on the message id plus a time based number (System.nanoseconds(), namely). This is *stupid*. There are potential collisions when computig such a cookie. I changed it to use an AtomicInteger - which as a side effect removed the local synchronization - and a 16 bits shift to the left to allow 2^16 cookie renewig for a single message - more than enough to cover every cases. I still have random issues at this point, but less frequently. What happens is that we receive a searchRequest with a cookie, just after the previous request has been completed. I have no idea why. If I add a Thread.sleep(10) in the doLoop() method of the test, I'm able to run 10000 times the paged search ( this is 40 000 paged search requests...). I will try tomorrow the same test but using our API instead of JNDI. Will keep you informed. -- Regards, Cordialement, Emmanuel Lécharny www.nextury.com