Changeset 29355


Ignore:
Timestamp:
2014-10-08T20:18:48+13:00 (10 years ago)
Author:
ak19
Message:

Overlooked a very important commit, but with corrections: solr cores should not be removed for solr/lucene 4.7.2 as they were for lucene/solr 3.3.0. However, all the solr cores do need to be shutdown on cleanUp() in order to not have the running GS3 server hold a lock on any of the cores, as this will prevent the GS3 tomcat from stopping fully, with part of tomcat still running in the background even if it looks like tomcat has stopped.

Location:
gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service/GS2SolrSearch.java

    r29228 r29355  
    163163        super.cleanUp();
    164164        this.solr_src.cleanUp();
     165
     166
     167        // 1. clear the map keeping track of the solrcores' EmbeddedSolrServers in this collection
     168        solr_core_cache.clear();
     169
     170        // 2. For solr 4.7.2., GLI (and ant stop from cmd) is unable to shutdown the tomcat server fully,
     171        // IF any collection has been previewed AND if there are any solr collections in the collect folder.
     172        // This is because although the GS3 server seems to have stopped running at this stage, running a
     173        // `ps aux | grep tomcat` reveals that some part of tomcat is still running. It seems to be still
     174        // holding on to the cores. Doing an all_cores.shutdown() here, stops GS3 from hanging on to the cores
     175        // while still preserving the core desciptions in web/ext/solr.xml as needed when restarting the GS3 server.
     176
     177        // Need GS3 server (tomcat) to release the cores, else a part of tomcat is still running in the background
     178        // on ant stop, holding a lock on the cores. Doing shutdown() preserves core descriptions in solr.xml
     179        all_solr_cores.shutdown();
     180        all_solr_cores = null;
     181       
     182        // For solr 3.3.0's jetty server, but not for solr 4.7.2's jetty server:
     183        /*
    165184
    166185        // When cleaning up, not only do we need to empty the solr_core_cache map, but we also need to remove all
     
    221240            }
    222241        }
     242        */
    223243    }
    224244
  • gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service/SolrSearch.java

    r29142 r29355  
    7979        solr_server.clear();
    8080
     81        // 2. Need GS3 server (tomcat) to release the cores, else a part of tomcat is still running in the background
     82        // on ant stop, holding a lock on the cores. Doing shutdown() preserves core descriptions in solr.xml
     83        solr_cores.shutdown();
     84        solr_cores = null;
     85
     86        // For solr 3.3.0's jetty server, but not for solr 4.7.2's jetty server
     87        /*
    8188        // 2. Remove all SolrCores in the CoreContainer (solr_cores) that are specific to this collection
    8289        String collection_core_name_prefix = getCollectionCoreNamePrefix();
     
    123130            }
    124131        }
    125    
     132        */
    126133    }
    127134
     
    146153            File solr_xml = new File( solr_home,"solr.xml" );
    147154           
    148             //solr_cores.load(solr_home_str,solr_xml);         
     155            //solr_cores.load(solr_home_str,solr_xml);
    149156            solr_cores.load();
    150157        } catch (Exception e) {
Note: See TracChangeset for help on using the changeset viewer.