Paul,

How often does your process start up? Are you really sure that there can never be two instances of your process running? If/when you gather the infoStream logs running up to this exception, can you also log when IndexReader.unLock is called?

Two writers on the same index can definitely cause the exception you are seeing.

I have a simple stress test running, which first indexes files in a set of recursive directories, and then iterates forever picking one dir, deleting its files and re-indexing them. I'm matching your code as far as I know so far (eg, opening a new writer to do the deletes, and another to index the docs). I'm running in two different unix/ JRE envs and so far they are running fine.

Besides changing mergeFactor, is there anything else you change on the IndexWriter?

Mike

Paul J. Lucas wrote:

On May 29, 2008, at 6:26 PM, Michael McCandless wrote:

Paul J. Lucas wrote:

        if ( IndexReader.isLocked( INDEX ) )
            IndexReader.unlock( INDEX );

The isLocked()/unlock() is because sometimes the server process gets killed and leaves teh indexed locked.

This makes me a bit nervous. Does this only run on startup of your process, or each time you need to open the IndexWriter?

Exactly once on start-up.

Could you add some logging whenever an unlock is necessary so we can double-check that you're not accidentally un-locking the lock out from under an IndexWriter (which could cause exactly this exception)?

Such logging is not necessary since the unlock() is done before any IndexWriter is ever created.

- Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to