dsmiley commented on code in PR #2811:
URL: https://github.com/apache/solr/pull/2811#discussion_r1827794290
##########
solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBSolrClient.java:
##########
@@ -480,14 +480,35 @@ private static boolean isTimeExceeded(long
timeAllowedNano, long timeOutTime) {
return timeAllowedNano > 0 && System.nanoTime() > timeOutTime;
}
+ private NamedList<Object> doMakeRequest(Endpoint endpoint, SolrRequest<?>
solrRequest)
+ throws SolrServerException, IOException {
+ final var solrClient = getClient(endpoint);
+ return doMakeRequest(solrClient, endpoint.getBaseUrl(),
endpoint.getCore(), solrRequest);
+ }
+
+ // TODO This special casing can be removed if either: (1) SOLR-16367 is
completed, or (2)
+ // LBHttp2SolrClient.getClient() is modified to return a client already
pointed at the correct URL
+ private NamedList<Object> doMakeRequest(
+ SolrClient solrClient, String baseUrl, String collection, SolrRequest<?>
solrRequest)
+ throws SolrServerException, IOException {
+ // Some implementations of LBSolrClient.getClient(...) return a
Http2SolrClient that may not be
+ // pointed at the desired URL (or any URL for that matter). We special
case that here to ensure
+ // the appropriate URL is provided.
+ if (solrClient instanceof Http2SolrClient) {
+ final var httpSolrClient = (Http2SolrClient) solrClient;
+ return httpSolrClient.requestWithBaseUrl(baseUrl, (c) ->
c.request(solrRequest, collection));
+ }
+
+ return solrClient.request(solrRequest, collection);
Review Comment:
I agree it's definitely worth its own ticket!
--
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]