lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pauli Østerø (JIRA) <>
Subject [jira] Commented: (LUCENENET-113) adding documents to index does, in rare cases, cause an access denied to segments.gen
Date Fri, 18 Apr 2008 15:44:21 GMT


Pauli Østerø commented on LUCENENET-113:

digy> The case is really simple. I have a an update routine that either creates or opens
my index, delete all the documents and adds new ones to it

IndexWriter indexWriter;

            if (!Directory.Exists(dir))
                indexWriter = new Lucene.Net.Index.IndexWriter(this.dir, new StandardAnalyzer(),
                indexWriter = new Lucene.Net.Index.IndexWriter(this.dir, new StandardAnalyzer(),



the UnauthorizedException always appears in either addSpeeddial or AddEmployees, which is
basicly just routines for fetching out information from a database and adding a document

                ... create fields-stringbuilder
                doc.Add(new Field("fields", fields.ToString().Trim(), Field.Store.NO, Field.Index.TOKENIZED));
                addDocument(doc, writer);

And now in my addDocument i have my try catch

private void addDocument(Document doc, IndexWriter writer)
            catch (UnauthorizedAccessException exc)

The bug appeared when releasing the code into production, and i think the reason why i havent
experienced it in development is because my testmachines have a rather slow connection to
the database meaning that  addDocument() wasn't beeing called so rapidly as on my production

I'll look into the cache of files-thing, but i doubt it since its on a production server without
svn or stuff like that.

> adding documents to index does, in rare cases, cause an access denied to segments.gen
> -------------------------------------------------------------------------------------
>                 Key: LUCENENET-113
>                 URL:
>             Project: Lucene.Net
>          Issue Type: Bug
>         Environment: Windows 2003
> Lucene.Net
>            Reporter: Pauli Østerø
>            Priority: Critical
> When updating an index via an indexwriter, does cause an access denied for segments.gen.
> After investigation with FileMon the problem seems to be Lucene deleting and creating
the segments.gen with such a speed, that Windows occasionally reports "DELETE PEND" when trying
to open the file, which causes Lucene to crash.
> A quick fix has been to do a try-catch when adding documents, and sleeping the thread
for 100 ms when encountering the UnathorizedException and trying to add the document again.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message