Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-1070

IndexSearcher not closed after indexing with DataImportHandler


    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 1.4
    • Component/s: clients - java
    • Labels:
    • Environment:

      Debian 2.6.26-1-xen-amd64
      Tomcat 5.5


      What I have noticed is afecting to the nightly build using multicore. I am using tomcat 5.5 server and Debian 2.6.26-1-xen-amd64.
      After indexing and optimizing with DataImporthandler the old IndexSearcher is not being proper closed.
      To reproduce the bug I have done a full-import from a mysql database optimizing at the end. Once done I change the data from the database and index optimizing again.
      When now I do a lsof | grep solr I can see that tomcat is holding the deleted files from old index.
      I can see the error in the stats screen aswell... if I do 4 full-imports, stats will show me 3 opened IndexSearchers.
      As I index on the master and never use it to serve search requests I have sorted it modifying the function getSearcher in SolrCore.java
      There's a part in the source where is coded:

      // we are all done with the old searcher we used
      // for warming...
      if (currSearcherHolderF!=null)


      I force there to close the indexSearcher and remvoe it from the RefCounted:

      // we are all done with the old searcher we used
      // for warming...
      if (currSearcherHolderF!=null){

      As Yonik told me:
      >> Forcing it to close at the point you did is unsafe since other threads
      >> may still be using that searcher.

      My solution is definitely not good if search requests must be served on that core of that server...




            • Assignee:
              sturlese Marc Sturlese
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: