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/28 14:47:48 UTC
[lucene-solr] branch reference_impl_dev updated: @610 Push a bit on
managed schema thread safety.
This is an automated email from the ASF dual-hosted git repository.
markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/reference_impl_dev by this push:
new 5ff8dfb @610 Push a bit on managed schema thread safety.
5ff8dfb is described below
commit 5ff8dfb2da8200627c86fb165c40ce89ad5d6d1d
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Fri Aug 28 09:47:08 2020 -0500
@610 Push a bit on managed schema thread safety.
---
.../src/java/org/apache/solr/schema/ZkIndexSchemaReader.java | 11 ++++++-----
.../json/DirectJsonQueryRequestFacetingIntegrationTest.java | 3 ---
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/solr/core/src/java/org/apache/solr/schema/ZkIndexSchemaReader.java b/solr/core/src/java/org/apache/solr/schema/ZkIndexSchemaReader.java
index d727c11..590ca89 100644
--- a/solr/core/src/java/org/apache/solr/schema/ZkIndexSchemaReader.java
+++ b/solr/core/src/java/org/apache/solr/schema/ZkIndexSchemaReader.java
@@ -40,10 +40,10 @@ import org.xml.sax.InputSource;
public class ZkIndexSchemaReader implements OnReconnect {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
private final ManagedIndexSchemaFactory managedIndexSchemaFactory;
- private SolrZkClient zkClient;
- private String managedSchemaPath;
+ private final SolrZkClient zkClient;
+ private final String managedSchemaPath;
private final String uniqueCoreId; // used in equals impl to uniquely identify the core that we're dependent on
- private SchemaWatcher schemaWatcher;
+ private volatile SchemaWatcher schemaWatcher;
public ZkIndexSchemaReader(ManagedIndexSchemaFactory managedIndexSchemaFactory, SolrCore solrCore) {
this.managedIndexSchemaFactory = managedIndexSchemaFactory;
@@ -110,7 +110,7 @@ public class ZkIndexSchemaReader implements OnReconnect {
*/
public static class SchemaWatcher implements Watcher {
- private ZkIndexSchemaReader schemaReader;
+ private volatile ZkIndexSchemaReader schemaReader;
public SchemaWatcher(ZkIndexSchemaReader reader) {
this.schemaReader = reader;
@@ -139,7 +139,8 @@ public class ZkIndexSchemaReader implements OnReconnect {
log.error("", e);
throw new ZooKeeperException(ErrorCode.SERVER_ERROR, "", e);
} catch (InterruptedException e) {
- ParWork.propegateInterrupt(e);
+ log.info("Interrupted", e);
+ // don't propegate interrupt in event thread
}
}
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/request/json/DirectJsonQueryRequestFacetingIntegrationTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/request/json/DirectJsonQueryRequestFacetingIntegrationTest.java
index 48f13c2..759d0ee 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/request/json/DirectJsonQueryRequestFacetingIntegrationTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/request/json/DirectJsonQueryRequestFacetingIntegrationTest.java
@@ -53,9 +53,6 @@ public class DirectJsonQueryRequestFacetingIntegrationTest extends SolrCloudTest
.addConfig(CONFIG_NAME, new File(ExternalPaths.TECHPRODUCTS_CONFIGSET).toPath())
.configure();
- final List<String> solrUrls = new ArrayList<>();
- solrUrls.add(cluster.getJettySolrRunner(0).getBaseUrl().toString());
-
CollectionAdminRequest.createCollection(COLLECTION_NAME, CONFIG_NAME, 1, 1).process(cluster.getSolrClient());
ContentStreamUpdateRequest up = new ContentStreamUpdateRequest("/update");