0

Directory lock error with Lucene.Net usage in an ASP.NET MVC site

Hi guys,

In the link above essentially is the issue I have.

However I am correctly disposing of the writer.

Problem is my main writer takes 20 mins due to the size of the data (200k + docs 25 Cols) and the slowness of the server.

So I have 2 writers one which does everything (all document on a 4 hour timer)

And one for when someone manually edits a column it removes a document and re adds it.

It is the second one that is throwing the timeout due to the fact that the first writer is still doing its thing taking forever. I would like to increase the timeout is this possible?

Cheers

Community
  • 1
  • 1
Spaceman
  • 1,319
  • 13
  • 42
  • Having a timeout of 20+ minutes sounds like a very bored user. Can't you process your content in small chunks, perhaps enough to just take a few seconds each, so that another writer may get some access to the index? – sisve Jan 08 '15 at 19:46
  • I was going to fire a thread that added it to the index so the user could keep on pedalin :). I think what we are leaning towards now is checking for the lock if it exists store the smaller modification to the index in a table that the larger modification checks apon completion. Would still be interested to know if you could extend the lock. – Spaceman Jan 08 '15 at 22:52

1 Answers1

1

You can change the lock timeout by increasing IndexWriter.WRITE_LOCK_TIMEOUT, or setting it to -1 to wait forever. There's also a Lock.LOCK_POLL_INTERVAL that states how often Lock.Obtain should attempt to retrieve the lock.

sisve
  • 19,501
  • 3
  • 53
  • 95