Yes, no locking is done anymore (as of 2.1) when opening IndexSearchers. So, it's fine.
Though... if they are within a single JRE, it's best to open a single IndexSearcher and share. Mike On Wed, Apr 8, 2009 at 5:14 PM, Zhang, Lisheng <lisheng.zh...@broadvision.com> wrote: > Hi, > > So it is always OK in 2.4 when multiple java processes > try to create IndexerSearcher at the same time? Just > want to make sure. > > I think upgrading should be the best option. > > Thanks very much for helps, Lisheng > > -----Original Message----- > From: Michael McCandless [mailto:luc...@mikemccandless.com] > Sent: Wednesday, April 08, 2009 1:59 PM > To: java-user@lucene.apache.org > Subject: Re: Lucene 1.4.3: Error when creating Searcher > > > Ahh yes right. If multiple IndexSearchers are trying to open at once, > they each try to acquire the commit lock and can thus starve one > another. > > The simplest workaround is to just keep retrying opening the IndexSearcher. > > Though if you accidentally get an orphan'd commit lock in the > directory (eg if the JRE was killed while IndexSearcher was trying to > open) then you'll have to remove that file. > > Or upgrade to Lucene >= 2.1 with lockless commits. > > Mike > > On Wed, Apr 8, 2009 at 4:47 PM, Zhang, Lisheng > <lisheng.zh...@broadvision.com> wrote: >> Hi, >> >> Client said they did not index, all they do is searching (create >> Searcher objects), I looked at 1.4.3 and think this issue can >> happen in: >> >> private static IndexReader open(final Directory directory, final boolean >> closeDirectory) >> syncronized(directory) {...} >> >> if calls are coming from different Java processes (in our case >> a few AppServer clusters)? >> >> Thanks very much for helps, Lisheng >> >> -----Original Message----- >> From: Michael McCandless [mailto:luc...@mikemccandless.com] >> Sent: Wednesday, April 08, 2009 1:00 PM >> To: java-user@lucene.apache.org >> Subject: Re: Lucene 1.4.3: Error when creating Searcher >> >> >> Likely your exception happened because a reader was trying to open >> just as a writer was committing, twice in a row. >> >> Do you commit (flush or close) frequently from your writer? >> >> As of 2.1, Lucene no longer uses a commit locks -- commits are now >> lockless, so you won't hit this on upgrading to 2.4. >> >> Mike >> >> On Wed, Apr 8, 2009 at 3:40 PM, Zhang, Lisheng >> <lisheng.zh...@broadvision.com> wrote: >>> Hi, >>> >>> Sorry that my initial message is not clear, I read lucene source code (both >>> 1.4.3 >>> and 2.4.0), and understood more. >>> >>> The problem is that when using lucene 1.4.3 sometimes when searching, we got >>> the error: >>> >>> Lock obtain timed out: >>> Lock@/tmp/lucene-ba94511756a2670adeac03a50532c63c-commit.lock >>> >>> It seems that in 2.4.0 we will never have this issue because this error can >>> only >>> happen when concurrent writing. >>> >>> Is this true? >>> >>> Thanks very much for helps, Lisheng >>> >>> >>>> -----Original Message----- >>>> From: Zhang, Lisheng >>>> Sent: Wednesday, April 08, 2009 9:08 AM >>>> To: 'java-user@lucene.apache.org' >>>> Subject: Lucene 1.4.3: Error when creating Searcher >>>> >>>> Hi, >>>> >>>> We are using lucene 1.4.3, sometimes when two threads try to search, >>>> one thread got error when creating MultiSearcher: >>>> >>>> Lock obtain timed out: >>>> Lock@/tmp/lucene-ba94511756a2670adeac03a50532c63c-commit.lock >>>> >>>> I read lucene FAQ and searched previous discussions, it seems that this >>>> error should be related to indexing, but we are only creating Searcher? >>>> >>>> Thanks very much for helps, Lisheng >>>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org >>> For additional commands, e-mail: java-user-h...@lucene.apache.org >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org >> For additional commands, e-mail: java-user-h...@lucene.apache.org >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org >> For additional commands, e-mail: java-user-h...@lucene.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org