[
https://issues.apache.org/jira/browse/SOLR-13044?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
David Smiley resolved SOLR-13044.
---------------------------------
Fix Version/s: 9.1
Assignee: David Smiley
Resolution: Fixed
> 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
> Assignee: David Smiley
> Priority: Major
> Fix For: 9.1
>
> Time Spent: 2h 20m
> 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.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]