mirror of https://github.com/apache/lucene.git
SOLR-7935:fix race that can cause a NPE in openNewSearcher called from an update concurrent with a core reload
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1696417 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3109c453bb
commit
bc6a8d9fff
|
@ -139,6 +139,9 @@ Bug Fixes
|
|||
|
||||
* SOLR-7920: Resolve XSS issue in Admin UI Schema Browser (David Chiu via Upayavira)
|
||||
|
||||
* SOLR-7935: Fix very rare race condition that can cause an update to fail
|
||||
via NullPointerException during a core reload. (yonik)
|
||||
|
||||
Optimizations
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -1584,8 +1584,8 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
|
|||
|
||||
// SolrCore.verbose("start reopen from",previousSearcher,"writer=",writer);
|
||||
|
||||
RefCounted<IndexWriter> writer = getUpdateHandler().getSolrCoreState()
|
||||
.getIndexWriter(null);
|
||||
RefCounted<IndexWriter> writer = getSolrCoreState().getIndexWriter(null);
|
||||
|
||||
try {
|
||||
if (writer != null) {
|
||||
// if in NRT mode, open from the writer
|
||||
|
@ -1639,7 +1639,7 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
|
|||
tmp = new SolrIndexSearcher(this, newIndexDir, getLatestSchema(),
|
||||
(realtime ? "realtime":"main"), newReader, true, !realtime, true, directoryFactory);
|
||||
} else {
|
||||
RefCounted<IndexWriter> writer = getUpdateHandler().getSolrCoreState().getIndexWriter(this);
|
||||
RefCounted<IndexWriter> writer = getSolrCoreState().getIndexWriter(this);
|
||||
DirectoryReader newReader = null;
|
||||
try {
|
||||
newReader = indexReaderFactory.newReader(writer.get(), this);
|
||||
|
|
Loading…
Reference in New Issue