epugh commented on code in PR #4513:
URL: https://github.com/apache/solr/pull/4513#discussion_r3391009707
##########
solr/core/src/java/org/apache/solr/cli/StreamTool.java:
##########
@@ -227,35 +227,52 @@ public void runImpl(CommandLine cli) throws Exception {
}
} finally {
pushBackStream.close();
- solrClientCache.close();
+ streamContext.getSolrClientCache().close();
}
echoIfVerbose("StreamTool -- Done.");
}
+ private StreamContext createStreamContext(CommandLine cli) throws Exception {
+ var jettyClientBuilder = new HttpJettySolrClient.Builder();
+ String credentials =
cli.getOptionValue(CommonCLIOptions.CREDENTIALS_OPTION);
+ if (credentials != null) {
+ String[] userPass = credentials.split(":");
+ jettyClientBuilder.withBasicAuthCredentials(userPass[0], userPass[1]);
+ }
+ HttpJettySolrClient client = jettyClientBuilder.build();
+
+ // subclass so we can ensure our client is closed when the cache is closed
Review Comment:
This is some magic! If this isn't there, do we see errors?
--
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]