mirror of https://github.com/apache/lucene.git
SOLR-1108 -- Remove un-needed synchronization in SolrCore constructor
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@767430 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1ea1e3ca37
commit
742731754d
|
@ -234,6 +234,9 @@ Optimizations
|
|||
8. SOLR-973: CommonsHttpSolrServer writes the xml directly to the server.
|
||||
(Noble Paul via shalin)
|
||||
|
||||
9. SOLR-1108: Remove un-needed synchronization in SolrCore constructor.
|
||||
(Noble Paul via shalin)
|
||||
|
||||
Bug Fixes
|
||||
----------------------
|
||||
1. SOLR-774: Fixed logging level display (Sean Timm via Otis Gospodnetic)
|
||||
|
|
|
@ -354,12 +354,14 @@ public final class SolrCore implements SolrInfoMBean {
|
|||
// protect via synchronized(SolrCore.class)
|
||||
private static Set<String> dirs = new HashSet<String>();
|
||||
|
||||
// currently only called with SolrCore.class lock held
|
||||
void initIndex() {
|
||||
try {
|
||||
File dirFile = new File(getNewIndexDir());
|
||||
boolean indexExists = dirFile.canRead();
|
||||
boolean firstTime = dirs.add(dirFile.getCanonicalPath());
|
||||
boolean firstTime;
|
||||
synchronized (SolrCore.class) {
|
||||
firstTime = dirs.add(dirFile.getCanonicalPath());
|
||||
}
|
||||
boolean removeLocks = solrConfig.getBool("mainIndex/unlockOnStartup", false);
|
||||
|
||||
initDirectoryFactory();
|
||||
|
@ -483,11 +485,7 @@ public final class SolrCore implements SolrInfoMBean {
|
|||
*@since solr 1.3
|
||||
*/
|
||||
public SolrCore(String name, String dataDir, SolrConfig config, IndexSchema schema, CoreDescriptor cd) {
|
||||
synchronized (SolrCore.class) {
|
||||
coreDescriptor = cd;
|
||||
// this is for backward compatibility (and also the reason
|
||||
// the sync block is needed)
|
||||
instance = this; // set singleton
|
||||
this.setName( name );
|
||||
SolrResourceLoader loader = config.getResourceLoader();
|
||||
if (dataDir == null)
|
||||
|
@ -569,14 +567,13 @@ public final class SolrCore implements SolrInfoMBean {
|
|||
// Finally tell anyone who wants to know
|
||||
loader.inform( loader );
|
||||
loader.inform( this );
|
||||
|
||||
instance = this; // set singleton for backwards compatibility
|
||||
} catch (IOException e) {
|
||||
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
|
||||
} finally {
|
||||
// allow firstSearcher events to fire
|
||||
latch.countDown();
|
||||
}
|
||||
} // end synchronized
|
||||
|
||||
infoRegistry.put("core", this);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue