You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Grant Ingersoll (JIRA)" <ji...@apache.org> on 2008/01/17 14:37:34 UTC

[jira] Updated: (LUCENE-1138) SpellChecker.clearIndex calls unlock inappropriately

     [ https://issues.apache.org/jira/browse/LUCENE-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Grant Ingersoll updated LUCENE-1138:
------------------------------------

    Attachment: LUCENE-1138.patch

Here's the fix for the spellchecker.  I confirmed this fixes the Solr issue.  I just put two isLocked() calls around the places where release and unlock are called.

> SpellChecker.clearIndex calls unlock inappropriately
> ----------------------------------------------------
>
>                 Key: LUCENE-1138
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1138
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 2.3
>            Reporter: Hoss Man
>            Assignee: Grant Ingersoll
>             Fix For: 2.3
>
>         Attachments: LUCENE-1138.patch
>
>
> As noted in LUCENE-1050, fixing a bug in SimpleLockFactory related to not reporting success/filure of lock file deletion has surfaced bad behavior in SpellChecker.clearIndex...
> Grant...
> {quote}
> It seems the SpellChecker is telling the IndexReader to delete the lockFile, but the lockFile doesn't exist.
>   ...
> I don't know much about the locking mechanism, but it seems like this should check to see if the lockFile exists before trying to delete it.
> {quote}
> Hoss...
> {quote}
> Grant: my take on this is that SpellChecker.clearIndex is in the wrong. it shouldn't be calling unlock unless it has reason to think there is a "stale lock" that needs to be closed - ie: this is a bug in SpellChecker that you have only discovered because this bug LUCENE-1050 was fixed.
> I would suggest a new issue for tracking, and a patch in which SpellChecker.clearIndex doesn't call unlock unless isLocked returns true. Even then, it might make sense to catch and ignore LockReleaseFailedException and let whatever resulting exception may originate from "new IndexWriter" be returned.
> {quote}
> marking for 2.3 since it seems like a fairly trivial fix, and if we don't deal with it now it will be a bug introduced in 2.3.

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


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