dsmiley commented on a change in pull request #1770:
URL: https://github.com/apache/lucene-solr/pull/1770#discussion_r475342747



##########
File path: 
solr/solrj/src/java/org/apache/solr/client/solrj/impl/BaseCloudSolrClient.java
##########
@@ -853,6 +858,18 @@ public RouteException(ErrorCode errorCode, 
NamedList<Throwable> throwables, Map<
 
   @Override
   public NamedList<Object> request(@SuppressWarnings({"rawtypes"})SolrRequest 
request, String collection) throws SolrServerException, IOException {
+      // synchronous requests should return an already completed future
+      return getNowOrException(makeRequest(request, collection, false));
+  }
+
+  CompletableFuture<NamedList<Object>> makeRequest(SolrRequest<?> request,
+                                                   String collection,
+                                                   boolean isAsyncRequest) 
throws SolrServerException, IOException {
+    if (isAsyncRequest && !(getLbClient() instanceof LBHttp2SolrClient)) {
+      log.warn("Asynchronous requests require HTTP/2 SolrJ client, defaulting 
to synchronous request.");
+      isAsyncRequest = false;

Review comment:
       What you propose sounds good Rishi.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to