[jira] [Created] (SOLR-13044) IndexFetcher.openNewSearcherAndUpdateCommitPoint can throw NPE on null SolrCore

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (SOLR-13044) IndexFetcher.openNewSearcherAndUpdateCommitPoint can throw NPE on null SolrCore

JIRA jira@apache.org
Hoss Man created SOLR-13044:
-------------------------------

             Summary: 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
      Security Level: Public (Default Security Level. Issues are Public)
            Reporter: Hoss Man


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
(v7.6.3#76005)

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