Return-Path: Delivered-To: apmail-lucene-solr-dev-archive@minotaur.apache.org Received: (qmail 91014 invoked from network); 28 Jan 2010 14:51:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Jan 2010 14:51:07 -0000 Received: (qmail 71258 invoked by uid 500); 28 Jan 2010 14:51:07 -0000 Delivered-To: apmail-lucene-solr-dev-archive@lucene.apache.org Received: (qmail 71197 invoked by uid 500); 28 Jan 2010 14:51:06 -0000 Mailing-List: contact solr-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-dev@lucene.apache.org Delivered-To: mailing list solr-dev@lucene.apache.org Received: (qmail 71187 invoked by uid 99); 28 Jan 2010 14:51:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jan 2010 14:51:06 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of markrmiller@gmail.com designates 209.85.221.188 as permitted sender) Received: from [209.85.221.188] (HELO mail-qy0-f188.google.com) (209.85.221.188) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jan 2010 14:50:57 +0000 Received: by qyk26 with SMTP id 26so238438qyk.5 for ; Thu, 28 Jan 2010 06:50:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=fycTfOt+iyba0XdEJtE13MvWYzaaffPDTYzEnZdzOkY=; b=laoTgRSQZX2umXCTPpDfinaZ5/hRitPwfPTjJtps+ppgTEZ9j0A+Oztw4Cz6T/fhAr hBkSHgxNjh0vO2KbmejpgbGM7I94BXARqr81KvPXgfsWRKQUbX4f4Z1Nb0rNa24KUtnM /0GBUqi8kPpI6+b93OH4IpnCALIG3GEui2cEs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=qCXM1rPJoaJ3OXhYS04eUQO61XtmNmChSVBVsx6FBKYRz13tuhO/jf2WGUuZud9/ni nkTZTEndE2E3qFRRywfl060Rwu+aEGGjKz2lvAB3RUkdbixvtl9/j//yB7O3keMTHXVt VS2xZai0KqKnri7W1nkvsLbrMyHhjd2/fr890= Received: by 10.224.5.78 with SMTP id 14mr1856665qau.361.1264690236614; Thu, 28 Jan 2010 06:50:36 -0800 (PST) Received: from ?192.168.1.104? (ool-44c639d9.dyn.optonline.net [68.198.57.217]) by mx.google.com with ESMTPS id 6sm2447572qwd.46.2010.01.28.06.50.35 (version=SSLv3 cipher=RC4-MD5); Thu, 28 Jan 2010 06:50:35 -0800 (PST) Message-ID: <4B61A43A.5080501@gmail.com> Date: Thu, 28 Jan 2010 09:50:34 -0500 From: Mark Miller User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: solr-dev@lucene.apache.org Subject: Re: svn commit: r899979 - /lucene/solr/trunk/example/solr/conf/solrconfig.xml References: <20100116153355.084D1238890A@eris.apache.org> <4B54931B.6090302@gmail.com> <4B5641B2.2020507@gmail.com> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Chris Hostetter wrote: > : > At a minimu, shouldn't NativeFSLock.obtain() be checking for > : > OverlappingFileLockException and treating that as a failure to acquire the > : > lock? > ... > : Perhaps - that should make it work in more cases - but in my simple > : testing its not 100% reliable. > ... > : File locks are held on behalf of the entire Java virtual machine. > : * They are not suitable for controlling access to a file by multiple > : * threads within the same virtual machine. > > ...Grrr.... so where does that leave us? > > Yonik's added comment was that "native" isnt' recommended when running > multiple webapps in the same container. in truth, "native" *can* > work when running multiple webapps in the same container, just as long as > those cotnainers don't refrence the same data dirs > > I'm worried that we should recommend people avoid native altogether > because even if you are only running one webapp, it seems like a "reload" > or that app could trigger some similar bad behavior. > > So what/how should we document all of this? > > -Hoss > > I've got more info on this. Checking for OverlappingFileLockException *should* actually work when using Java 1.6. Java 1.6 started using a *system wide* thread safe check for this. Previous to Java 1.6, checks for this *were* limited to an instance of FileChannel - the FileChannel maintained its own personal lock list. So you have to use the same Channel to even have any hope of seeing an OverlappingFileLockException. Even then though, its not properly thread safe. They did not sync across checking if the lock exists and acquiring the lock - they separately sync each action - leaving room to acquire the lock twice from two different threads like I was seeing. Interestingly, Java 1.6 has a back compat mode you can turn on that doesn't use the system wide lock list, and they have fixed this thread safety issue in that impl - there is a sync across checking and getting the lock so that it is properly thread safe - but not in Java 1.4, 1.5. Looking at GCC - uh ... I don't think you want to use GCC - they don't appear to use a lock list and check for this at all :) But the point is, this is fixable on Java 6 if we check for OverlappingFileLockException - it *should* work across webapps, and it is actually thread safe, unlike Java 1.4,1.5. -- - Mark http://www.lucidimagination.com