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

Adrien Grand commented on LUCENE-6533:
--------------------------------------

Thanks Mike for creating an isolated test case.

The reason why I added this assertion in the first place was to make live docs 
consistent with terms enums and dvs, which are cached per thread and should not 
leak. While it's not really needed today given how live docs are implemented, 
it could be if we ever want to have disk-based live docs.

We could fix the issue by not caching live docs anymore in 
SlowCompositeReaderWrapper and moving the MultiFields.getLiveDocs(in) call from 
SlowCompositeReaderWrapper constructor to 
SlowCompositeReaderWrapper.getLiveDocs (just like we arleady do for our other 
random-access data-structures like norms or doc values).

> SlowCompositeReaderWrapper is caching an AssertingBits instance
> ---------------------------------------------------------------
>
>                 Key: LUCENE-6533
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6533
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 5.3, Trunk
>
>         Attachments: LUCENE-6533.patch
>
>
> I hit this curious failure in the new TestGeoPointQuery:
> {noformat}
>    [junit4]   2> มิ.ย. 09, 2015 12:49:55 ก่อนเที่ยง 
> com.carrotsearch.randomizedtesting.RandomizedRunner$QueueUncaughtExceptionsHandler
>  uncaughtException
>    [junit4]   2> WARNING: Uncaught exception in thread: 
> Thread[T1,5,TGRP-TestGeoPointQuery]
>    [junit4]   2> java.lang.AssertionError: Bits are only supposed to be 
> consumed in the thread in which they have been acquired. But was acquired in 
> Thread[TEST-TestGeoPointQuery.testRandom-seed#[173A293B58C5F8A1],5,TGRP-TestGeoPointQuery]
>  and consumed in Thread[T1,5,TGRP-TestGeoPointQuery].
>    [junit4]   2>      at 
> __randomizedtesting.SeedInfo.seed([173A293B58C5F8A1]:0)
>    [junit4]   2>      at 
> org.apache.lucene.index.AssertingLeafReader.assertThread(AssertingLeafReader.java:39)
>    [junit4]   2>      at 
> org.apache.lucene.index.AssertingLeafReader.access$000(AssertingLeafReader.java:33)
>    [junit4]   2>      at 
> org.apache.lucene.index.AssertingLeafReader$AssertingBits.get(AssertingLeafReader.java:769)
>    [junit4]   2>      at 
> org.apache.lucene.search.LRUQueryCache$CachingWrapperWeight$1.matches(LRUQueryCache.java:606)
>    [junit4]   2>      at 
> org.apache.lucene.search.TwoPhaseIterator$1.doNext(TwoPhaseIterator.java:69)
>    [junit4]   2>      at 
> org.apache.lucene.search.TwoPhaseIterator$1.nextDoc(TwoPhaseIterator.java:57)
>    [junit4]   2>      at 
> org.apache.lucene.search.ConstantScoreScorer.nextDoc(ConstantScoreScorer.java:78)
>    [junit4]   2>      at 
> org.apache.lucene.search.Weight$DefaultBulkScorer.scoreAll(Weight.java:204)
>    [junit4]   2>      at 
> org.apache.lucene.search.Weight$DefaultBulkScorer.score(Weight.java:176)
>    [junit4]   2>      at 
> org.apache.lucene.search.AssertingBulkScorer.score(AssertingBulkScorer.java:79)
>    [junit4]   2>      at 
> org.apache.lucene.search.AssertingBulkScorer.score(AssertingBulkScorer.java:63)
>    [junit4]   2>      at 
> org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:563)
>    [junit4]   2>      at 
> org.apache.lucene.search.AssertingIndexSearcher.search(AssertingIndexSearcher.java:92)
>    [junit4]   2>      at 
> org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:367)
>    [junit4]   2>      at 
> org.apache.lucene.search.TestGeoPointQuery$1._run(TestGeoPointQuery.java:382)
>    [junit4]   2>      at 
> org.apache.lucene.search.TestGeoPointQuery$1.run(TestGeoPointQuery.java:309)
>    [junit4]   2> 
>    [junit4]   2> NOTE: reproduce with: ant test  -Dtestcase=TestGeoPointQuery 
> -Dtests.method=testRandom -Dtests.seed=173A293B58C5F8A1 -Dtests.slow=true 
> -Dtests.linedocsfile=/lucenedata/hudson.enwiki.random.lines.txt.fixed 
> -Dtests.locale=th -Dtests.timezone=Africa/Djibouti -Dtests.asserts=true 
> -Dtests.file.encoding=UTF-8
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to