mirror of https://github.com/apache/lucene.git
SOLR-509: Fix NPE when starting up SolrCore due to FirstSearcher event not being initialized
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@649046 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
783bd8c9e9
commit
e2583ca6dd
|
@ -355,6 +355,7 @@ Bug Fixes
|
||||||
when no RequestHandler is mapped to "/update") now logs error correctly.
|
when no RequestHandler is mapped to "/update") now logs error correctly.
|
||||||
(hossman)
|
(hossman)
|
||||||
|
|
||||||
|
26. SOLR-509: Moved firstSearcher event notification to the end of the SolrCore constructor (Koji Sekiguchi via gsingers)
|
||||||
|
|
||||||
Other Changes
|
Other Changes
|
||||||
1. SOLR-135: Moved common classes to org.apache.solr.common and altered the
|
1. SOLR-135: Moved common classes to org.apache.solr.common and altered the
|
||||||
|
|
|
@ -396,6 +396,29 @@ public final class SolrCore {
|
||||||
// Finally tell anyone who wants to know
|
// Finally tell anyone who wants to know
|
||||||
loader.inform( loader );
|
loader.inform( loader );
|
||||||
loader.inform( this );
|
loader.inform( this );
|
||||||
|
|
||||||
|
// execute firstSearcher event
|
||||||
|
//TODO: It may not always be the case that this is the only time the first searcher event needs to fire.
|
||||||
|
doFirstSearcherEvent(getSearcher().get());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void doFirstSearcherEvent(final SolrIndexSearcher firstSearcher){
|
||||||
|
if (firstSearcherListeners.size() > 0) {
|
||||||
|
searcherExecutor.submit(
|
||||||
|
new Callable() {
|
||||||
|
public Object call() throws Exception {
|
||||||
|
try {
|
||||||
|
for (SolrEventListener listener : firstSearcherListeners) {
|
||||||
|
listener.newSearcher(firstSearcher,null);
|
||||||
|
}
|
||||||
|
} catch (Throwable e) {
|
||||||
|
SolrException.logOnce(log,null,e);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -780,23 +803,6 @@ public final class SolrCore {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currSearcher==null && firstSearcherListeners.size() > 0) {
|
|
||||||
future = searcherExecutor.submit(
|
|
||||||
new Callable() {
|
|
||||||
public Object call() throws Exception {
|
|
||||||
try {
|
|
||||||
for (SolrEventListener listener : firstSearcherListeners) {
|
|
||||||
listener.newSearcher(newSearcher,null);
|
|
||||||
}
|
|
||||||
} catch (Throwable e) {
|
|
||||||
SolrException.logOnce(log,null,e);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (currSearcher!=null && newSearcherListeners.size() > 0) {
|
if (currSearcher!=null && newSearcherListeners.size() > 0) {
|
||||||
future = searcherExecutor.submit(
|
future = searcherExecutor.submit(
|
||||||
new Callable() {
|
new Callable() {
|
||||||
|
|
Loading…
Reference in New Issue