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/08/31 15:40:43 UTC

[lucene-solr] branch reference_impl updated (ff972b4 -> 4f04ab5)

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

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


    from ff972b4  @646 Try boosting non nightly http2 client timeout a bit for GraphExpressionTest, which can hang on hitting an idle_timeout (oddly slow test sometimes).
     new f50dd42  @647 Bring a few things back.
     new 3628a7f  Avoid leaked stateProvider (held by builder) that causes hangs in test shutdown
     new 4f04ab5  @648 Switch to the root pool.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/solr/core/SolrXmlConfig.java   | 79 +++++++++++++++-------
 .../java/org/apache/solr/core/XmlConfigFile.java   |  3 +-
 .../test/org/apache/solr/core/TestBadConfig.java   |  3 +-
 .../client/solrj/impl/CloudHttp2SolrClient.java    |  5 ++
 .../client/solrj/io/graph/ShortestPathStream.java  |  2 +-
 .../java/org/apache/solr/cloud/ZkTestServer.java   |  4 +-
 .../solr/core/AbstractBadConfigTestBase.java       |  5 +-
 7 files changed, 67 insertions(+), 34 deletions(-)


[lucene-solr] 02/03: Avoid leaked stateProvider (held by builder) that causes hangs in test shutdown

Posted by ma...@apache.org.
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 3628a7f16860434c10172bdb073043c013d463ac
Author: Timothy Potter <th...@gmail.com>
AuthorDate: Mon Aug 31 09:16:02 2020 -0600

    Avoid leaked stateProvider (held by builder) that causes hangs in test shutdown
---
 .../java/org/apache/solr/client/solrj/impl/CloudHttp2SolrClient.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudHttp2SolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudHttp2SolrClient.java
index 1f7ad8f..6cbbc1a 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudHttp2SolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudHttp2SolrClient.java
@@ -283,6 +283,10 @@ public class CloudHttp2SolrClient  extends BaseCloudSolrClient {
      */
     public CloudHttp2SolrClient build() {
       CloudHttp2SolrClient cloudClient = new CloudHttp2SolrClient(this);
+      /*
+
+      TJP ~ this leaks the stateProvider created here and causes tests to hang
+
       if (stateProvider == null) {
         if (!zkHosts.isEmpty()) {
           stateProvider = new ZkClientClusterStateProvider(cloudClient.getZkStateReader());
@@ -299,6 +303,7 @@ public class CloudHttp2SolrClient  extends BaseCloudSolrClient {
           throw new IllegalArgumentException("Both zkHosts and solrUrl cannot be null.");
         }
       }
+       */
       return cloudClient;
     }
 


[lucene-solr] 01/03: @647 Bring a few things back.

Posted by ma...@apache.org.
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 f50dd42959d4cc788e8be9a98d7ac73e41938618
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Mon Aug 31 10:14:44 2020 -0500

    @647 Bring a few things back.
---
 .../java/org/apache/solr/core/SolrXmlConfig.java   | 79 +++++++++++++++-------
 .../java/org/apache/solr/core/XmlConfigFile.java   |  3 +-
 .../test/org/apache/solr/core/TestBadConfig.java   |  3 +-
 .../java/org/apache/solr/cloud/ZkTestServer.java   |  4 +-
 .../solr/core/AbstractBadConfigTestBase.java       |  5 +-
 5 files changed, 61 insertions(+), 33 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/core/SolrXmlConfig.java b/solr/core/src/java/org/apache/solr/core/SolrXmlConfig.java
index 3ba5912..fff409e 100644
--- a/solr/core/src/java/org/apache/solr/core/SolrXmlConfig.java
+++ b/solr/core/src/java/org/apache/solr/core/SolrXmlConfig.java
@@ -77,32 +77,36 @@ public class SolrXmlConfig {
   private static XPathExpression transientCoreCacheFactoryExp;
   private static XPathExpression tracerConfigExp;
 
+  private static XPathExpression coreLoadThreadsExp;
+  private static XPathExpression persistentExp;
+  private static XPathExpression sharedLibExp;
+  private static XPathExpression zkHostExp;
+  private static XPathExpression coresExp;
 
-  static String shardHandlerFactoryPath = "solr/shardHandlerFactory";
 
+  static String shardHandlerFactoryPath = "solr/shardHandlerFactory";
   static String counterExpPath = "solr/metrics/suppliers/counter";
   static String meterPath = "solr/metrics/suppliers/meter";
-
   static String timerPath = "solr/metrics/suppliers/timer";
-
   static String histoPath = "solr/metrics/suppliers/histogram";
-
   static String historyPath = "solr/metrics/history";
-
   static String  transientCoreCacheFactoryPath =  "solr/transientCoreCacheFactory";
-
   static String  tracerConfigPath = "solr/tracerConfig";
 
+  static String  coreLoadThreadsPath = "solr/@coreLoadThreads";
+  static String  persistentPath = "solr/@persistent";
+  static String  sharedLibPath = "solr/@sharedLib";
+  static String  zkHostPath = "solr/@zkHost";
+  static String  coresPath = "solr/cores";
+
   static {
 
     XPath xPath = XmlConfigFile.getXpath();
     try {
-
       shardHandlerFactoryExp = xPath.compile(shardHandlerFactoryPath);
     } catch (XPathExpressionException e) {
       log.error("", e);
     }
-
     try {
       counterExp = xPath.compile(counterExpPath);
     } catch (XPathExpressionException e) {
@@ -139,6 +143,31 @@ public class SolrXmlConfig {
       log.error("", e);
     }
 
+    try {
+      coreLoadThreadsExp = xPath.compile(coreLoadThreadsPath);
+    } catch (XPathExpressionException e) {
+      log.error("", e);
+    }
+    try {
+      persistentExp = xPath.compile(persistentPath);
+    } catch (XPathExpressionException e) {
+      log.error("", e);
+    }
+    try {
+      sharedLibExp = xPath.compile(sharedLibPath);
+    } catch (XPathExpressionException e) {
+      log.error("", e);
+    }
+    try {
+      zkHostExp = xPath.compile(zkHostPath);
+    } catch (XPathExpressionException e) {
+      log.error("", e);
+    }
+    try {
+      coresExp = xPath.compile(coresPath);
+    } catch (XPathExpressionException e) {
+      log.error("", e);
+    }
   }
 
   public static NodeConfig fromConfig(Path solrHome, XmlConfigFile config, boolean fromZookeeper) {
@@ -254,17 +283,17 @@ public class SolrXmlConfig {
   }
 
   private static void checkForIllegalConfig(XmlConfigFile config) {
-    // woah! it's best if we don't do this - resource killer - note: perhaps not as bad now that xml is more efficient?
-//    failIfFound(config, "solr/@coreLoadThreads");
-//    failIfFound(config, "solr/@persistent");
-//    failIfFound(config, "solr/@sharedLib");
-//    failIfFound(config, "solr/@zkHost");
-//    failIfFound(config, "solr/cores");
-//
-//    assertSingleInstance("solrcloud", config);
-//    assertSingleInstance("logging", config);
-//    assertSingleInstance("logging/watcher", config);
-//    assertSingleInstance("backup", config);
+    // was resource killer - note: perhaps not as bad now that xml is more efficient?
+    failIfFound(config, coreLoadThreadsExp, coreLoadThreadsPath);
+    failIfFound(config, persistentExp, persistentPath);
+    failIfFound(config, sharedLibExp, sharedLibPath);
+    failIfFound(config, zkHostExp, zkHostPath);
+    failIfFound(config, coresExp, coresPath);
+
+    assertSingleInstance("solrcloud", config);
+    assertSingleInstance("logging", config);
+    assertSingleInstance("logging/watcher", config);
+    assertSingleInstance("backup", config);
   }
 
   private static void assertSingleInstance(String section, XmlConfigFile config) {
@@ -272,13 +301,11 @@ public class SolrXmlConfig {
       throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Multiple instances of " + section + " section found in solr.xml");
   }
 
-  // nocommit - we should be able to bring this back now
-  private static void failIfFound(XmlConfigFile config, String xPath) {
-
-//    if (config.getVal(xPath, false) != null) {
-//      throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Should not have found " + xPath +
-//          "\n. Please upgrade your solr.xml: https://lucene.apache.org/solr/guide/format-of-solr-xml.html");
-//    }
+  private static void failIfFound(XmlConfigFile config, XPathExpression xPath, String path) {
+    if (config.getVal(xPath, path,false) != null) {
+      throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Should not have found " + xPath +
+          "\n. Please upgrade your solr.xml: https://lucene.apache.org/solr/guide/format-of-solr-xml.html");
+    }
   }
 
   private static Properties loadProperties(XmlConfigFile config) {
diff --git a/solr/core/src/java/org/apache/solr/core/XmlConfigFile.java b/solr/core/src/java/org/apache/solr/core/XmlConfigFile.java
index a0d946b..b97bbe1 100644
--- a/solr/core/src/java/org/apache/solr/core/XmlConfigFile.java
+++ b/solr/core/src/java/org/apache/solr/core/XmlConfigFile.java
@@ -320,7 +320,8 @@ public class XmlConfigFile { // formerly simply "Config"
       }
     }
 
-    public NodeList getNodeList (String path,boolean errIfMissing){
+    // TODO: more precompiled expressions
+    public NodeList getNodeList (String path, boolean errIfMissing){
       String xstr = normalize(path);
 
       try {
diff --git a/solr/core/src/test/org/apache/solr/core/TestBadConfig.java b/solr/core/src/test/org/apache/solr/core/TestBadConfig.java
index 5a957f3..4fc8b2b 100644
--- a/solr/core/src/test/org/apache/solr/core/TestBadConfig.java
+++ b/solr/core/src/test/org/apache/solr/core/TestBadConfig.java
@@ -44,7 +44,8 @@ public class TestBadConfig extends AbstractBadConfigTestBase {
                     "useCompoundFile");
   }
 
-  @Ignore // nocommit debug
+  @Ignore // this fails because a small change is that currently, a SolrCore failing in CoreContainer#load will
+  // not fail with an exception, though the exception will be logged - we should check the core init exceptions here
   public void testUpdateLogButNoVersionField() throws Exception {
     
     System.setProperty("enable.update.log", "true");
diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/ZkTestServer.java b/solr/test-framework/src/java/org/apache/solr/cloud/ZkTestServer.java
index 17dd48b..dc7393a 100644
--- a/solr/test-framework/src/java/org/apache/solr/cloud/ZkTestServer.java
+++ b/solr/test-framework/src/java/org/apache/solr/cloud/ZkTestServer.java
@@ -410,8 +410,8 @@ public class ZkTestServer implements Closeable {
             cnxnFactory.shutdown();
 
             cnxnFactory.join();
-            // eats some extra sleep time not to do this, but I think it can cause spurious fails
-            //((Thread)zkServer.zooKeeperServer.getSessionTracker()).interrupt();
+            // NOT IDEAL, BUT THIS CAN SLEEP A BIT BEFORE EXIT
+            ((Thread)zkServer.zooKeeperServer.getSessionTracker()).interrupt();
             ((Thread)zkServer.zooKeeperServer.getSessionTracker()).join();
             return cnxnFactory;
           });
diff --git a/solr/test-framework/src/java/org/apache/solr/core/AbstractBadConfigTestBase.java b/solr/test-framework/src/java/org/apache/solr/core/AbstractBadConfigTestBase.java
index 17fe188..7430b06 100644
--- a/solr/test-framework/src/java/org/apache/solr/core/AbstractBadConfigTestBase.java
+++ b/solr/test-framework/src/java/org/apache/solr/core/AbstractBadConfigTestBase.java
@@ -61,8 +61,7 @@ public abstract class AbstractBadConfigTestBase extends SolrTestCaseJ4 {
         if (matches(entry.getValue().exception, errString))
           return;
       }
-    }
-    catch (Exception e) {
+    } catch (Throwable e) {
       ParWork.propegateInterrupt(e);
       if (matches(e, errString))
         return;
@@ -75,7 +74,7 @@ public abstract class AbstractBadConfigTestBase extends SolrTestCaseJ4 {
     fail("Did not encounter any exception from: " + solrconfigFile + " using " + schemaFile);
   }
 
-  private static boolean matches(Exception e, String errString) {
+  private static boolean matches(Throwable e, String errString) {
     for (Throwable t = e; t != null; t = t.getCause()) {
       if (t.getMessage() != null && -1 != t.getMessage().indexOf(errString))
         return true;


[lucene-solr] 03/03: @648 Switch to the root pool.

Posted by ma...@apache.org.
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 4f04ab5f36a379c88bca1e508ca6ca559bade9ec
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Mon Aug 31 10:18:56 2020 -0500

    @648 Switch to the root pool.
---
 .../java/org/apache/solr/client/solrj/io/graph/ShortestPathStream.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/graph/ShortestPathStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/graph/ShortestPathStream.java
index e53310c..3698ee3 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/graph/ShortestPathStream.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/graph/ShortestPathStream.java
@@ -297,7 +297,7 @@ public class ShortestPathStream extends TupleStream implements Expressible {
     List<Edge> targets = new ArrayList();
     ExecutorService threadPool = null;
 
-    threadPool = ParWork.getMyPerThreadExecutor();
+    threadPool = ParWork.getRootSharedExecutor();
 
     //Breadth first search
     TRAVERSE: