lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yahootintin.1247...@bloglines.com
Subject Re: Locks and Readers and Writers
Date Sat, 06 Nov 2004 00:35:26 GMT
Ok, I simplified my test case a little...  I removed the UNC share which is
a remote file share that Windows supports.

I have two processes running
on the same Windows XP machine.
1) The first process uses an IndexWriter
to writes to the index and then closes the IndexWriter.  
2) The first process
sends a multicast event to the other process.
3) The other process opens
an IndexReader.
4) Meanwhile, the first process tries to open the index again
to do a write.
5) Often the IndexWriter gets an error: Lock obtain timed
out

Any advice?  Is this only a problem on Windows?

Here's the stack
trace:
java.io.IOException: Lock obtain timed out: Lock@C:\WINDOWS\TEMP\lucene-9906f192fb41cc8775cf839213997b7e-commit.lock

	at org.apache.lucene.store.Lock.obtain(Lock.java:58)
	at org.apache.lucene.store.Lock$With.run(Lock.java:108)

	at org.apache.lucene.index.IndexWriter.mergeSegments(IndexWriter.java:501)

	at org.apache.lucene.index.IndexWriter.maybeMergeSegments(IndexWriter.java:458)

	at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:310)


--- Lucene Users List" <lucene-user@jakarta.apache.org wrote:
yahootintin.1247688@bloglines.com
writes:
> > Hi Christoph,
> > 
> > Thats what I thought.  But what I'm
seeing is this:
> > - open
> > reader for searching
> > (the reader is
opening an index on a remote machine
> > (via UNC) which takes a couple seconds)

> > - meanwhile the other service opens
> > an IndexWriter and adds a document

> > (the index writer determines that it needs
> > to merge so it tries
to get a lock.  since the reader is still opening, the
> > IO exception is
thrown)
> > 
> > I believe that increasing the merge factor will
> > reduce
the opportunity for this to occur.  But it will still occur at some
> > point.

> > 
> I'm not sure what you mean by `opening an index on a remote machine
(via 
> UNC)' but have you made sure that lock files are put in the same
directory
> for both processes (see the mailing list archive for details)?

> Also note, that lucene's locking is known not to work on NFS (also see
the
> list archive). I don't know if it works on SMB mounts.
> 
> Morus

> 
> ---------------------------------------------------------------------

> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For
additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message