"org.apache.solr.core.SolrCore Too many close [count:-1] on
org.apache.solr.core.SolrCore@51af7c57"
-error
pull/1/head
Michael Peter Christen 11 years ago
parent 69391e5d9e
commit 1a364572a5

@ -73,6 +73,10 @@ public class CachedSolrConnector extends AbstractSolrConnector implements SolrCo
this.documentCache.clear();
if (this.solr != null) this.solr.commit(true);
}
protected void finalize() throws Throwable {
this.close();
}
@Override
public synchronized void close() {

@ -141,12 +141,18 @@ public class EmbeddedSolrConnector extends SolrServerConnector implements SolrCo
public SolrConfig getConfig() {
return this.core.getSolrConfig();
}
protected void finalize() throws Throwable {
this.close();
}
@Override
public synchronized void close() {
try {this.commit(false);} catch (final Throwable e) {ConcurrentLog.logException(e);}
if (this.core != null && !this.core.isClosed()) try {this.commit(false);} catch (final Throwable e) {ConcurrentLog.logException(e);}
try {super.close();} catch (final Throwable e) {ConcurrentLog.logException(e);}
try {this.core.close();} catch (final Throwable e) {ConcurrentLog.logException(e);}
// we do NOT close the core here because that is closed if the enclosing instance is closed
// do NOT uncomment the following line, which caused a "org.apache.solr.core.SolrCore Too many close [count:-1] on org.apache.solr.core.SolrCore@51af7c57" error
// try {this.core.close();} catch (final Throwable e) {ConcurrentLog.logException(e);}
}
@Override

@ -205,10 +205,17 @@ public class EmbeddedInstance implements SolrInstance {
this.cores.put(name, c);
return c;
}
protected void finalize() throws Throwable {
this.close();
}
@Override
public synchronized void close() {
try {this.coreContainer.shutdown();} catch (final Throwable e) {ConcurrentLog.logException(e);}
if (this.coreContainer != null) try {
this.coreContainer.shutdown();
this.coreContainer = null;
} catch (final Throwable e) {ConcurrentLog.logException(e);}
}
}

Loading…
Cancel
Save