You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Michael McCandless (JIRA)" <ji...@apache.org> on 2007/12/20 23:39:43 UTC

[jira] Updated: (LUCENE-1097) IndexWriter.close(false) does not actually stop background merge threads

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

Michael McCandless updated LUCENE-1097:
---------------------------------------

    Attachment: LUCENE-1097.patch

Patch attached.  I plan to commit in a day or two.

I changed SegmentMerger to periodically check whether the merge has
been aborted, and changed IndexWriter.close(false) to mark all merges
as aborted and then wait for them to actually finish.

I changed it so when a merge is aborted it throws an explicit
exception (MergeAbortedException) which is cleaner than before when
any number of exceptions could be thrown.

I also added a test case to IndexWriter to test closing a writer w/
doWait=false while another thread is still adding documents, which
uncovered a deadlock case, that I also fixed.


> IndexWriter.close(false) does not actually stop background merge threads
> ------------------------------------------------------------------------
>
>                 Key: LUCENE-1097
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1097
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 2.3
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.3
>
>         Attachments: LUCENE-1097.patch
>
>
> Right now when you close(false), IndexWriter marks any running merges
> as aborted but then does not wait for these merges to finish.  This
> can cause problems because those threads still hold files open, so,
> someone might think they can call close(false) and then (say) delete
> all files from that directory, which would fail on Windows.
> Instead, close(false) should notify each running merge that it has
> been aborted, and not return until all running merges are done.  Then,
> SegmentMerger should periodically check whether it has been aborted
> and stop if so.

-- 
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