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 2014/08/14 14:51:11 UTC

[jira] [Commented] (LUCENE-5885) MergeScheduler should not implement Closeable

    [ https://issues.apache.org/jira/browse/LUCENE-5885?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14096926#comment-14096926 ] 

Michael McCandless commented on LUCENE-5885:
--------------------------------------------

+1 to remove Closeable.

I think the sync() that CMS does in close today can be dropped: IW already finishes all merges itself.

> MergeScheduler should not implement Closeable
> ---------------------------------------------
>
>                 Key: LUCENE-5885
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5885
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/index
>            Reporter: Shai Erera
>
> MergeScheduler implements Closeable and IndexWriter calls ms.close() when it's closed. But MergeScheduler can be shared between several writers, which means closing it by any particular writer is wrong. We should rather implement some ref-counting logic such that each IW will call incRef() in the ctor, and decRef() on close(), and MergeScheduler will truly close when the ref-count hits 0.
> As it is now, if you share a MergeScheduler between writers and close() does something terminating, I doubt if it really works.
> Also, when I look at ConcurrentMergeScheduler.close(), it calls sync() which joins all MergeThreads. But if that CMS instance is shared between few IWs, doesn't it mean that a single IW calling close() waits on MergeThreads that execute merges of other IWs!?!? This seems ... wrong?



--
This message was sent by Atlassian JIRA
(v6.2#6252)

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