You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/09/02 18:12:00 UTC

[lucene-solr] 03/11: @705 Handle rare case.

This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch reference_impl
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 6c5f73b44994ad16d04da570d98137731da95853
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Wed Sep 2 09:17:34 2020 -0500

    @705 Handle rare case.
---
 solr/core/src/java/org/apache/solr/update/UpdateHandler.java | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/solr/core/src/java/org/apache/solr/update/UpdateHandler.java b/solr/core/src/java/org/apache/solr/update/UpdateHandler.java
index 59a99bc..95dc7e4 100644
--- a/solr/core/src/java/org/apache/solr/update/UpdateHandler.java
+++ b/solr/core/src/java/org/apache/solr/update/UpdateHandler.java
@@ -16,9 +16,11 @@
  */
 package org.apache.solr.update;
 
+import org.apache.solr.common.AlreadyClosedException;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.util.IOUtils;
 import org.apache.solr.common.util.ObjectReleaseTracker;
+import org.apache.solr.core.CoreDescriptor;
 import org.apache.solr.core.DirectoryFactory;
 import org.apache.solr.core.HdfsDirectoryFactory;
 import org.apache.solr.core.PluginInfo;
@@ -129,13 +131,17 @@ UpdateHandler implements SolrInfoBean, Closeable {
     ObjectReleaseTracker.track(this);
     try {
       this.core = core;
+      CoreDescriptor cd = core.getCoreDescriptor();
+      if (cd == null) {
+        throw new AlreadyClosedException();
+      }
       idField = core.getLatestSchema().getUniqueKeyField();
       idFieldType = idField != null ? idField.getType() : null;
       parseEventListeners();
       PluginInfo ulogPluginInfo = core.getSolrConfig().getPluginInfo(UpdateLog.class.getName());
 
       // If this is a replica of type PULL, don't create the update log
-      boolean skipUpdateLog = core.getCoreDescriptor().getCloudDescriptor() != null && !core.getCoreDescriptor().getCloudDescriptor().requiresTransactionLog();
+      boolean skipUpdateLog = cd.getCloudDescriptor() != null && !cd.getCloudDescriptor().requiresTransactionLog();
       if (updateLog == null && ulogPluginInfo != null && ulogPluginInfo.isEnabled() && !skipUpdateLog) {
         DirectoryFactory dirFactory = core.getDirectoryFactory();
         if (dirFactory instanceof HdfsDirectoryFactory) {