dsmiley commented on code in PR #1256:
URL: https://github.com/apache/solr/pull/1256#discussion_r1060216195


##########
solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java:
##########
@@ -2283,6 +2292,26 @@ protected CloudSolrClient getCommonCloudSolrClient() {
     return commonCloudSolrClient;
   }
 
+  protected CloudSolrClient getSolrClientForCollection(String collectionName) {
+    synchronized (this) {
+      if (!solrClientForCollectionCache.containsKey(collectionName)) {

Review Comment:
   No, use `computeIfAbsent` instead of synchronization, since you chose to use 
ConcurrentHashMap (which makes sense).  It's faster and safer.  This may 
explain why Lift/Infer complained because you are using synchronized here but 
not in destroyServers when you called clear() on the map.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to