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

Chris M. Hostetter commented on SOLR-13044:
-------------------------------------------

I only vaguely remember this issue, but yeah, "do nothing" is probably fine.

Have you by any chance been able to reliably reproduce & test this fix in the 
"core is closing" situation?

I'm wondering if "do nothing" here just kicks the can down the road and causes 
the caller(s) of this method to get a similar failure somewhere else (or worse: 
start making some on disk changes that fail part way through)

> IndexFetcher.openNewSearcherAndUpdateCommitPoint can throw NPE on null 
> SolrCore
> -------------------------------------------------------------------------------
>
>                 Key: SOLR-13044
>                 URL: https://issues.apache.org/jira/browse/SOLR-13044
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Chris M. Hostetter
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> While working through the logs in SOLR-13031, i observed the following...
> {noformat}
>   [beaster]   2> 57230 ERROR (indexFetcher-193-thread-1) [    ] 
> o.a.s.h.ReplicationHandler Index fetch failed 
> :org.apache.solr.common.SolrException: Index fetch failed : 
>   [beaster]   2>        at 
> org.apache.solr.handler.IndexFetcher.fetchLatestIndex(IndexFetcher.java:676)
>   [beaster]   2>        at 
> org.apache.solr.handler.IndexFetcher.fetchLatestIndex(IndexFetcher.java:346)
>   [beaster]   2>        at 
> org.apache.solr.handler.ReplicationHandler.doFetch(ReplicationHandler.java:424)
>   [beaster]   2>        at 
> org.apache.solr.handler.ReplicationHandler.lambda$setupPolling$13(ReplicationHandler.java:1184)
>   [beaster]   2>        at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>   [beaster]   2>        at 
> java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
>   [beaster]   2>        at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
>   [beaster]   2>        at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
>   [beaster]   2>        at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>   [beaster]   2>        at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>   [beaster]   2>        at java.lang.Thread.run(Thread.java:748)
>   [beaster]   2> Caused by: java.lang.NullPointerException
>   [beaster]   2>        at 
> org.apache.solr.handler.IndexFetcher.openNewSearcherAndUpdateCommitPoint(IndexFetcher.java:909)
>   [beaster]   2>        at 
> org.apache.solr.handler.IndexFetcher.fetchLatestIndex(IndexFetcher.java:653)
>   [beaster]   2>        ... 10 more
> {noformat}
> Which comes from this bit of code...
> {code:java}
>     // must get the latest solrCore object because the one we have might be 
> closed because of a reload
>     // todo stop keeping solrCore around
>     SolrCore core = solrCore.getCoreContainer().getCore(solrCore.getName());
>     try {
>       Future[] waitSearcher = new Future[1];
>       searcher = core.getSearcher(true, true, waitSearcher, true);
>       if (waitSearcher[0] != null) {
>         try {
>           waitSearcher[0].get();
>         } catch (InterruptedException | ExecutionException e) {
>           SolrException.log(log, e);
>         }
>       }
>       commitPoint = searcher.get().getIndexReader().getIndexCommit();
>     } finally {
>       if (searcher != null) {
>         searcher.decref();
>       }
>       core.close(); // IndexFetcher.java:909 where NPE is being thrown
>     }
> {code}
> IIUC: openNewSearcherAndUpdateCommitPoint isn't accounting for the 
> possibility that the the IndexFetcher is getting run before the SolrCore has 
> been fully initialized and regsitere with the CoreContainer and/or 
> after/while the SolrCore (and/or CoreContainer) is in the process of being 
> closed, and isn't available from 
> {{solrCore.getCoreContainer().getCore(String)}}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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

Reply via email to