HoustonPutman commented on code in PR #909: URL: https://github.com/apache/solr/pull/909#discussion_r910384430
########## solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java: ########## @@ -326,12 +408,11 @@ public void forciblyRefreshAllClusterStateSlow() throws KeeperException, Interru // No need to set watchers because we should already have watchers registered for everything. refreshCollectionList(null); refreshLiveNodes(null); - // Need a copy so we don't delete from what we're iterating over. - Collection<String> safeCopy = new ArrayList<>(watchedCollectionStates.keySet()); + Set<String> updatedCollections = new HashSet<>(); - for (String coll : safeCopy) { + for (String coll : collectionWatches.keySet()) { Review Comment: I don't think that we actually want any of the null collections, right? They would only be null if they stopped existing, correct? I might be wrong here ########## solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java: ########## @@ -1640,7 +1727,6 @@ public void unregisterCore(String collection) { if (v == null) return null; if (v.coreRefCount > 0) v.coreRefCount--; if (v.canBeRemoved()) { - watchedCollectionStates.remove(collection); lazyCollectionStates.put(collection, new LazyCollectionRef(collection)); reconstructState.set(true); return null; Review Comment: So what happens when you return `null` in the compute? Does it delete the entry in the map or does it set the value to `null`? If it's the later, then we do need the null checks in all of the methods that interact with the `collectionWatches` values. -- 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