dsmiley commented on code in PR #3740:
URL: https://github.com/apache/solr/pull/3740#discussion_r2446207849
##########
solr/core/src/java/org/apache/solr/core/CoreContainer.java:
##########
@@ -281,7 +281,7 @@ public JerseyAppHandlerCache getJerseyAppHandlerCache() {
protected MetricsHandler metricsHandler;
- private volatile SolrClientCache solrClientCache;
+ // SolrClientCache is now stored in objectCache with key "solrClientCache"
Review Comment:
remember to remove this
##########
solr/core/src/java/org/apache/solr/core/CoreContainer.java:
##########
@@ -1234,9 +1238,8 @@ public void shutdown() {
} catch (Exception e) {
log.warn("Error shutting down CoreAdminHandler. Continuing to close
CoreContainer.", e);
}
- if (solrClientCache != null) {
- solrClientCache.close();
- }
+ // SolrClientCache is stored in objectCache with key "solrClientCache"
+ // and will be closed when objectCache is closed
Review Comment:
same; remove this
##########
solr/core/src/java/org/apache/solr/core/CoreContainer.java:
##########
@@ -787,7 +790,8 @@ private void loadInternal() {
solrClientProvider =
new HttpSolrClientProvider(cfg.getUpdateShardHandlerConfig(),
solrMetricsContext);
updateShardHandler.initializeMetrics(solrMetricsContext,
Attributes.empty());
- solrClientCache = new SolrClientCache(solrClientProvider.getSolrClient());
+ // We don't pre-initialize SolrClientCache here anymore
+ // It will be created on-demand in getSolrClientCache() when first needed
Review Comment:
Comments like this are are PR review like comments but I don't think should
be committed to the code.
##########
solr/core/src/java/org/apache/solr/core/CoreContainer.java:
##########
@@ -814,7 +818,7 @@ private void loadInternal() {
zkSys.initZooKeeper(this, cfg.getCloudConfig());
if (isZooKeeperAware()) {
- solrClientCache.setDefaultZKHost(getZkController().getZkServerAddress());
+
getSolrClientCache().setDefaultZKHost(getZkController().getZkServerAddress());
Review Comment:
this line should really be a part of the initialization you put in
computeIfAbsent, since that executes lazily.
--
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]