[ https://issues.apache.org/jira/browse/LUCENE-743?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12538705 ]
Michael McCandless commented on LUCENE-743: ------------------------------------------- Patch looks great! I'm still working through it but found a few small issues... It might be good to put a "assert refCount > 0" at various places like decRef(), incRef(), ensureOpen()? That would require changing the constructors to init refCount=1 rather than incRef() it to 1. I'm seeing a failure in contrib/memory testcase: {code} [junit] *********** FILE=./NOTICE.txt [junit] Fatal error at query=Apache, file=./NOTICE.txt, [EMAIL PROTECTED] [junit] ------------- ---------------- --------------- [junit] Testcase: testMany(org.apache.lucene.index.memory.MemoryIndexTest): Caused an ERROR [junit] this IndexReader is closed [junit] org.apache.lucene.store.AlreadyClosedException: this IndexReader is closed [junit] at org.apache.lucene.index.IndexReader.ensureOpen(IndexReader.java:158) [junit] at org.apache.lucene.index.IndexReader.termDocs(IndexReader.java:632) [junit] at org.apache.lucene.search.TermQuery$TermWeight.scorer(TermQuery.java:64) [junit] at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:143) [junit] at org.apache.lucene.search.Searcher.search(Searcher.java:118) [junit] at org.apache.lucene.search.Searcher.search(Searcher.java:97) [junit] at org.apache.lucene.index.memory.MemoryIndexTest.query(MemoryIndexTest.java:412) [junit] at org.apache.lucene.index.memory.MemoryIndexTest.run(MemoryIndexTest.java:313) [junit] at org.apache.lucene.index.memory.MemoryIndexTest.testMany(MemoryIndexTest.java:234) {code} I think it's because MemoryIndexReader (private class in MemoryIndex.java) calls super(null) = IndexReader.IndexReader(Directory) in its constructor, which does not initialize the refCount to 1? If I insert incRef() into IndexReader.IndexReader(Directory) constructor, the test passes, but who else is using that constructor (ie will this double-incref in those cases?). > IndexReader.reopen() > -------------------- > > Key: LUCENE-743 > URL: https://issues.apache.org/jira/browse/LUCENE-743 > Project: Lucene - Java > Issue Type: Improvement > Components: Index > Reporter: Otis Gospodnetic > Assignee: Michael Busch > Priority: Minor > Fix For: 2.3 > > Attachments: IndexReaderUtils.java, lucene-743-take2.patch, > lucene-743-take3.patch, lucene-743.patch, lucene-743.patch, lucene-743.patch, > MyMultiReader.java, MySegmentReader.java, > varient-no-isCloneSupported.BROKEN.patch > > > This is Robert Engels' implementation of IndexReader.reopen() functionality, > as a set of 3 new classes (this was easier for him to implement, but should > probably be folded into the core, if this looks good). -- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]