[ 
https://issues.apache.org/jira/browse/SOLR-6864?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hoss Man reopened SOLR-6864:
----------------------------

i''ve got a seed here that causes the newly added test to fail 100% of the time 
on trunk...

{noformat}
   [junit4]   2> NOTE: reproduce with: ant test  -Dtestcase=TestIndexSearcher 
-Dtests.method=testSearcherListeners -Dtests.seed=72D3132D566B9448 
-Dtests.slow=true -Dtests.locale=es_PR -Dtests.timezone=America/Blanc-Sablon 
-Dtests.asserts=true -Dtests.file.encoding=UTF-8
   [junit4] FAILURE 0.86s | TestIndexSearcher.testSearcherListeners <<<
   [junit4]    > Throwable #1: java.lang.AssertionError: expected:<1> but 
was:<0>
   [junit4]    >        at 
__randomizedtesting.SeedInfo.seed([72D3132D566B9448:DB7AC2090729EE8C]:0)
   [junit4]    >        at 
org.apache.solr.search.TestIndexSearcher.createCoreAndValidateListeners(TestIndexSearcher.java:219)
   [junit4]    >        at 
org.apache.solr.search.TestIndexSearcher.testSearcherListeners(TestIndexSearcher.java:194)
   [junit4]    >        at java.lang.Thread.run(Thread.java:745)
{noformat}

> Support registering searcher listeners in SolrCoreAware.inform(SolrCore) 
> method
> -------------------------------------------------------------------------------
>
>                 Key: SOLR-6864
>                 URL: https://issues.apache.org/jira/browse/SOLR-6864
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 5.0, Trunk
>            Reporter: Tomás Fernández Löbbe
>            Assignee: Tomás Fernández Löbbe
>             Fix For: 5.0, Trunk
>
>         Attachments: SOLR-6864.patch
>
>
> I'm marking this Jira as Bug because we already have components that do this 
> (SuggestComponent and SpellcheckComponent), however, listeners registered at 
> this stage not always work.
> From 
> https://issues.apache.org/jira/browse/SOLR-6845?focusedCommentId=14250350&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14250350
> {quote}
> Trying to add some unit tests to this feature I found another issue. 
> SuggestComponent and SpellcheckComponent rely on a {{firstSearcherListener}} 
> to load (and in this case, also build) some structures. These 
> firstSearcherListeners are registered on {{SolrCoreAware.inform()}}, however 
> the first searcher listener task is only added to the queue of warming tasks 
> if there is at least one listener registered at the time of the first 
> searcher creation (before SolrCoreAware.inform() is ever called). See 
> {code:title=SolrCore.java}
>         if (currSearcher == null && firstSearcherListeners.size() > 0) {
>           future = searcherExecutor.submit(new Callable() {
>             @Override
>             public Object call() throws Exception {
>               try {
>                 for (SolrEventListener listener : firstSearcherListeners) {
>                   listener.newSearcher(newSearcher, null);
>                 }
>               } catch (Throwable e) {
>                 SolrException.log(log, null, e);
>                 if (e instanceof Error) {
>                   throw (Error) e;
>                 }
>               }
>               return null;
>             }
>           });
>         }
> {code}
> I'll create a new Jira for this
> {quote}



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