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

[lucene-solr] branch branch_8x updated: SOLR-14151: Fixing TestBulkSchemaConcurrent failures

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

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


The following commit(s) were added to refs/heads/branch_8x by this push:
     new 641589a  SOLR-14151: Fixing TestBulkSchemaConcurrent failures
641589a is described below

commit 641589a9fbe7c01be9b340133d49b33ad64d21ea
Author: noblepaul <no...@gmail.com>
AuthorDate: Mon Sep 14 15:42:11 2020 +1000

    SOLR-14151: Fixing TestBulkSchemaConcurrent failures
---
 solr/core/src/java/org/apache/solr/core/ConfigSet.java | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/core/ConfigSet.java b/solr/core/src/java/org/apache/solr/core/ConfigSet.java
index 8112477..7161bc1 100644
--- a/solr/core/src/java/org/apache/solr/core/ConfigSet.java
+++ b/solr/core/src/java/org/apache/solr/core/ConfigSet.java
@@ -30,6 +30,7 @@ public class ConfigSet {
   private final String name;
 
   private final SolrConfig solrconfig;
+  private IndexSchema schema;
 
   private final SchemaSupplier schemaSupplier;
 
@@ -40,10 +41,11 @@ public class ConfigSet {
 
   @SuppressWarnings({"rawtypes"})
   public ConfigSet(String name, SolrConfig solrConfig, SchemaSupplier indexSchemaSupplier,
-      NamedList properties, boolean trusted) {
+                   NamedList properties, boolean trusted) {
     this.name = name;
     this.solrconfig = solrConfig;
     this.schemaSupplier = indexSchemaSupplier;
+    schema = schemaSupplier.get(true);
     this.properties = properties;
     this.trusted = trusted;
   }
@@ -61,17 +63,18 @@ public class ConfigSet {
    * @param forceFetch get a fresh value and not cached value
    */
   public IndexSchema getIndexSchema(boolean forceFetch) {
-    return schemaSupplier.get(forceFetch);
+    if(forceFetch)  schema = schemaSupplier.get(true);
+    return schema;
   }
   public IndexSchema getIndexSchema() {
-    return schemaSupplier.get(false);
+    return schema;
   }
 
   @SuppressWarnings({"rawtypes"})
   public NamedList getProperties() {
     return properties;
   }
-  
+
   public boolean isTrusted() {
     return trusted;
   }
@@ -82,7 +85,7 @@ public class ConfigSet {
    * So, we may not be able to update the core if we the schema classes are updated
    * */
   interface SchemaSupplier {
-     IndexSchema get(boolean forceFetch);
+    IndexSchema get(boolean forceFetch);
 
   }
 }