gortiz commented on code in PR #14730:
URL: https://github.com/apache/pinot/pull/14730#discussion_r1899996475


##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotControllerLogger.java:
##########
@@ -224,18 +224,16 @@ public Response downloadLogFileFromInstance(
       if (authorization != null) {
         requestBuilder.addHeader(HttpHeaders.AUTHORIZATION, authorization);
       }
-      try (CloseableHttpResponse httpResponse = 
_fileUploadDownloadClient.getHttpClient()
-          .execute(requestBuilder.build())) {
-        if (httpResponse.getCode() >= 400) {
-          throw new 
WebApplicationException(IOUtils.toString(httpResponse.getEntity().getContent(), 
"UTF-8"),
-              Response.Status.fromStatusCode(httpResponse.getCode()));
-        }
-        Response.ResponseBuilder builder = Response.ok();
-        builder.entity(httpResponse.getEntity().getContent());
-        builder.contentLocation(uri);
-        builder.header(HttpHeaders.CONTENT_LENGTH, 
httpResponse.getEntity().getContentLength());
-        return builder.build();
+      CloseableHttpResponse httpResponse = 
_fileUploadDownloadClient.getHttpClient().execute(requestBuilder.build());

Review Comment:
   Given these downloads may be large, we need to be sure we are cleaning these 
resources in a correct fashion. Alternatively we can dump the content of the 
stream to a file and use that file to stream data to the incoming request, but 
then we will need to be sure we end up deleting the file



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