lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [04/50] [abbrv] lucene-solr:jira/solr-11320: SOLR-11426: TestLazyCores fails too often, trying to debug
Date Tue, 17 Oct 2017 15:53:17 GMT
SOLR-11426: TestLazyCores fails too often, trying to debug


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/e92bde1e
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/e92bde1e
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/e92bde1e

Branch: refs/heads/jira/solr-11320
Commit: e92bde1e7ece020d581638f4c59c3840bf75d183
Parents: f0a4b2d
Author: Erick Erickson <erick@apache.org>
Authored: Sat Oct 7 22:12:03 2017 -0700
Committer: Erick Erickson <erick@apache.org>
Committed: Sat Oct 7 22:12:03 2017 -0700

----------------------------------------------------------------------
 .../src/java/org/apache/solr/core/SolrCores.java   | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e92bde1e/solr/core/src/java/org/apache/solr/core/SolrCores.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/SolrCores.java b/solr/core/src/java/org/apache/solr/core/SolrCores.java
index 7f4b9a0..52b1063 100644
--- a/solr/core/src/java/org/apache/solr/core/SolrCores.java
+++ b/solr/core/src/java/org/apache/solr/core/SolrCores.java
@@ -19,12 +19,17 @@ package org.apache.solr.core;
 import com.google.common.collect.Lists;
 import org.apache.http.annotation.Experimental;
 import org.apache.solr.common.SolrException;
+import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.util.ExecutorUtil;
 import org.apache.solr.logging.MDCLoggingContext;
+import org.apache.solr.request.LocalSolrQueryRequest;
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.update.CommitUpdateCommand;
 import org.apache.solr.util.DefaultSolrThreadFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.IOException;
 import java.lang.invoke.MethodHandles;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -538,7 +543,17 @@ class SolrCores implements Observer {
   @Override
   public void update(Observable o, Object arg) {
     synchronized (modifyLock) {
-      pendingCloses.add((SolrCore) arg); // Essentially just queue this core up for closing.
+      SolrCore core = (SolrCore) arg;
+      SolrQueryRequest req = new LocalSolrQueryRequest(core, new ModifiableSolrParams());
+      CommitUpdateCommand cmd = new CommitUpdateCommand(req, false);
+      cmd.openSearcher = false;
+      cmd.waitSearcher = false;
+      try {
+        core.getUpdateHandler().commit(cmd);
+      } catch (IOException e) {
+        log.warn("Caught exception trying to close a transient core, ignoring as it should
be benign");
+      }
+      pendingCloses.add(core); // Essentially just queue this core up for closing.
       modifyLock.notifyAll(); // Wakes up closer thread too
     }
   }


Mime
View raw message