noblepaul commented on code in PR #1964: URL: https://github.com/apache/solr/pull/1964#discussion_r1510479018
########## solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkStateReader.java: ########## @@ -1763,26 +1784,29 @@ public void registerCollectionStateWatcher( * <p>The Watcher will automatically be removed when it's <code>onStateChanged</code> returns * <code>true</code> */ - public void registerDocCollectionWatcher(String collection, DocCollectionWatcher stateWatcher) { - AtomicBoolean watchSet = new AtomicBoolean(false); + public void registerDocCollectionWatcher( + String collection, DocCollectionWatcher docCollectionWatcher) { + AtomicReference<StateWatcher> newWatcherRef = new AtomicReference<>(); collectionWatches.compute( collection, (k, v) -> { if (v == null) { - v = new StatefulCollectionWatch(); - watchSet.set(true); + StateWatcher stateWatcher = new StateWatcher(collection); Review Comment: same here too ``` v = new StatefulCollectionWatch(new StateWatcher(collection)); newWatcherRef.set(v.associatedWatcher); ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org