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 2008/04/23 15:27:21 UTC

[jira] Created: (LUCENE-1270) After IW.addIndexesNoOptimize, IW.close may hang

After IW.addIndexesNoOptimize, IW.close may hang
------------------------------------------------

                 Key: LUCENE-1270
                 URL: https://issues.apache.org/jira/browse/LUCENE-1270
             Project: Lucene - Java
          Issue Type: Bug
          Components: Index
    Affects Versions: 2.3.1, 2.3
            Reporter: Michael McCandless
            Assignee: Michael McCandless
            Priority: Minor
             Fix For: 2.3.2, 2.4
         Attachments: LUCENE-1270.patch

Spinoff from here:

  http://mail-archives.apache.org/mod_mbox/lucene-java-user/200804.mbox/%3c43128.192.168.1.71.1208561409.webmail@192.168.1.71%3e

The addIndexesNoOptimize method first merges eligible segments
according to the MergePolicy, and then copies over one by one any
remaining "external" segments.

That copy can possibly (rather rarely) result in new merges becoming
eligible because its size can change if the index being added was
created with autoCommit=false.

However, we fail to then invoke the MergeScheduler to run these
merges.  As a result, in close, where we wait until all running and
pending merges complete, we will never return.

The fix is simple: invoke the merge scheduler inside
copyExternalSegments() if any segments were copied.  I also added
defensive invocation of the merge scheduler during close, just in case
other code paths could allow for a merge to be added to the pending
queue but not scheduled.



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


[jira] Resolved: (LUCENE-1270) After IW.addIndexesNoOptimize, IW.close may hang

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1270?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless resolved LUCENE-1270.
----------------------------------------

    Resolution: Fixed

Thanks Stu!

> After IW.addIndexesNoOptimize, IW.close may hang
> ------------------------------------------------
>
>                 Key: LUCENE-1270
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1270
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Index
>    Affects Versions: 2.3, 2.3.1
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.3.2, 2.4
>
>         Attachments: LUCENE-1270.patch
>
>
> Spinoff from here:
>   http://mail-archives.apache.org/mod_mbox/lucene-java-user/200804.mbox/%3c43128.192.168.1.71.1208561409.webmail@192.168.1.71%3e
> The addIndexesNoOptimize method first merges eligible segments
> according to the MergePolicy, and then copies over one by one any
> remaining "external" segments.
> That copy can possibly (rather rarely) result in new merges becoming
> eligible because its size can change if the index being added was
> created with autoCommit=false.
> However, we fail to then invoke the MergeScheduler to run these
> merges.  As a result, in close, where we wait until all running and
> pending merges complete, we will never return.
> The fix is simple: invoke the merge scheduler inside
> copyExternalSegments() if any segments were copied.  I also added
> defensive invocation of the merge scheduler during close, just in case
> other code paths could allow for a merge to be added to the pending
> queue but not scheduled.

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


[jira] Updated: (LUCENE-1270) After IW.addIndexesNoOptimize, IW.close may hang

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1270?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless updated LUCENE-1270:
---------------------------------------

    Attachment: LUCENE-1270.patch

Attached patch.  I plan to commit, to 2.4 & 2.3.2, later today.

> After IW.addIndexesNoOptimize, IW.close may hang
> ------------------------------------------------
>
>                 Key: LUCENE-1270
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1270
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Index
>    Affects Versions: 2.3, 2.3.1
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.3.2, 2.4
>
>         Attachments: LUCENE-1270.patch
>
>
> Spinoff from here:
>   http://mail-archives.apache.org/mod_mbox/lucene-java-user/200804.mbox/%3c43128.192.168.1.71.1208561409.webmail@192.168.1.71%3e
> The addIndexesNoOptimize method first merges eligible segments
> according to the MergePolicy, and then copies over one by one any
> remaining "external" segments.
> That copy can possibly (rather rarely) result in new merges becoming
> eligible because its size can change if the index being added was
> created with autoCommit=false.
> However, we fail to then invoke the MergeScheduler to run these
> merges.  As a result, in close, where we wait until all running and
> pending merges complete, we will never return.
> The fix is simple: invoke the merge scheduler inside
> copyExternalSegments() if any segments were copied.  I also added
> defensive invocation of the merge scheduler during close, just in case
> other code paths could allow for a merge to be added to the pending
> queue but not scheduled.

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