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

Andrzej Bialecki  edited comment on SOLR-13694 at 8/14/19 7:21 AM:
-------------------------------------------------------------------

Indeed, it's a bug in {{IndexSizeEstimator}} - it appears that the 
{{StoredFieldsReader}} is not supposed to be closed other than from within 
CodecReader.close().

SimpleTextCodec / SimpleTextStoreFieldsReader doesn't override 
getMergeInstance(), which means it returns itself, unlike all other codecs 
which return a clone of the stream in a new instance of {{StoredFieldsReader}}.

Still, I'm not sure if the new instance should be closed? Closing a clone of a 
stream doesn't close the original stream so I _think_ that the merge instance, 
when different from the original, still should be closed.


was (Author: ab):
Indeed, it's a bug in {{IndexSizeEstimator}} - the {{StoredFieldsReader}} is 
not supposed to be closed other than from within CodecReader.close(). I'll fix 
it in a moment.

(SimpleTextCodec / SimpleTextStoreFieldsReader doesn't override 
getMergeInstance(), which means it returns itself, unlike all other codecs 
which return a clone).

> IndexSizeEstimator NullPointerException
> ---------------------------------------
>
>                 Key: SOLR-13694
>                 URL: https://issues.apache.org/jira/browse/SOLR-13694
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Hoss Man
>            Assignee: Andrzej Bialecki 
>            Priority: Major
>         Attachments: SOLR-13694.patch
>
>
> Jenkins found a reproducible seed for trigging an NPE in 
> IndexSizeEstimatorTest
> Based on a little experimental tracing i did, this might be a real bug in 
> IndexSizeEstimator? ... it's calling close on StoredFieldsReader instances it 
> gets from the CodecReader -- but AFAICT from the docs/code i'm not certain if 
> it should be doing this.  It appears the expectation is that this is direct 
> access to the internal state, that will automatically be closed when the 
> CodecReader is closed.
> ie: IndexSizeEstimator is closing StoredFieldsReader pre-maturely, causing it 
> to be unusbale on the next iteration.
> (I didn't dig in far enough to guess if there are other places in the 
> IndexSizeEstimator code that are closing CodecReader internals prematurely as 
> well, or just in this situation ... it's also not clear if this only causes 
> failures because this seed uses SimpleTextCodec, and other codecs are more 
> forgiving -- or if something else about the index(es) generated for this seed 
> are what cause the problem to manifest)
> http://fucit.org/solr-jenkins-reports/job-data/apache/Lucene-Solr-NightlyTests-master/1928
> {noformat}
> hossman@tray:~/lucene/dev/solr/core [j11] [master] $ git rev-parse HEAD
> 0291db44bc8e092f7cb2f577f0ac8ab6fa6a5fd7
> hossman@tray:~/lucene/dev/solr/core [j11] [master] $ ant test  
> -Dtestcase=IndexSizeEstimatorTest -Dtests.method=testEstimator 
> -Dtests.seed=23F60434E13D8FD4 -Dtests.multiplier=2 -Dtests.nightly=true 
> -Dtests.slow=true  -Dtests.locale=eo -Dtests.timezone=Atlantic/Madeira 
> -Dtests.asserts=true -Dtests.file.encoding=UTF-8
> ...
>    [junit4]   2> NOTE: reproduce with: ant test  
> -Dtestcase=IndexSizeEstimatorTest -Dtests.method=testEstimator 
> -Dtests.seed=23F60434E13D8FD4 -Dtests.multiplier=2 -Dtests.nightly=true 
> -Dtests.slow=true -Dtests.badapples=true -Dtests.locale=eo 
> -Dtests.timezone=Atlantic/Madeira -Dtests.asserts=true 
> -Dtests.file.encoding=UTF-8
>    [junit4] ERROR   0.88s | IndexSizeEstimatorTest.testEstimator <<<
>    [junit4]    > Throwable #1: java.lang.NullPointerException
>    [junit4]    >        at 
> __randomizedtesting.SeedInfo.seed([23F60434E13D8FD4:EC2B6B666D451E64]:0)
>    [junit4]    >        at 
> org.apache.lucene.codecs.simpletext.SimpleTextStoredFieldsReader.visitDocument(SimpleTextStoredFieldsReader.java:109)
>    [junit4]    >        at 
> org.apache.solr.handler.admin.IndexSizeEstimator.estimateStoredFields(IndexSizeEstimator.java:513)
>    [junit4]    >        at 
> org.apache.solr.handler.admin.IndexSizeEstimator.estimate(IndexSizeEstimator.java:198)
>    [junit4]    >        at 
> org.apache.solr.handler.admin.IndexSizeEstimatorTest.testEstimator(IndexSizeEstimatorTest.java:117)
>    [junit4]    >        at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>    [junit4]    >        at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>    [junit4]    >        at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>    [junit4]    >        at 
> java.base/java.lang.reflect.Method.invoke(Method.java:566)
>    [junit4]    >        at java.base/java.lang.Thread.run(Thread.java:834)
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

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

Reply via email to