serhiy-bzhezytskyy commented on code in PR #4639:
URL: https://github.com/apache/solr/pull/4639#discussion_r3597206048


##########
solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpJdkSolrClient.java:
##########
@@ -144,8 +144,10 @@ protected HttpJdkSolrClient(String serverBaseUrl, 
HttpJdkSolrClient.Builder buil
   protected CompletableFuture<HttpResponse<InputStream>> 
requestInputStreamAsync(
       String baseUrl, final SolrRequest<?> solrRequest, String collection) {
     try {
-      HttpRequest httpRequest = prepareRequest(baseUrl, solrRequest, 
collection).reqb.build();
-      return httpClient.sendAsync(httpRequest, 
HttpResponse.BodyHandlers.ofInputStream());
+      PreparedRequest pReq = prepareRequest(baseUrl, solrRequest, collection);

Review Comment:
   Kept `pReq` here rather than inlining the `HttpRequest` build because the 
`.whenComplete(... releaseContentWriting(pReq))` needs the `PreparedRequest` to 
reach the content-writing sink/future — that's the cleanup this fix adds. 
Inlining the build the way it was before would drop the `pReq` reference. Happy 
to reshape if you see a cleaner way.



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