From b3044d6a04b16dcdf2c05c0410d86eb5c593c43b Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Wed, 19 Feb 2014 01:58:16 +0000 Subject: [PATCH] SOLR-5620: ZKStateReader.aliases should be volatile to ensure all threads see the latest aliases. git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1569603 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 3 +++ .../src/java/org/apache/solr/common/cloud/ZkStateReader.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 141ab2610c2..a0ef7384d8c 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -346,6 +346,9 @@ Bug Fixes * SOLR-5741: UpdateShardHandler was not correctly setting max total connections on the HttpClient. (Shawn Heisey) +* SOLR-5620: ZKStateReader.aliases should be volatile to ensure all threads see + the latest aliases. (Ramkumar Aiyengar via Mark Miller) + Optimizations ---------------------- diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java index c1e1a16f684..a1f024453aa 100644 --- a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java +++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java @@ -180,7 +180,7 @@ public class ZkStateReader { private ZkCmdExecutor cmdExecutor; - private Aliases aliases = new Aliases(); + private volatile Aliases aliases = new Aliases(); private volatile boolean closed = false;