shounakmk219 commented on code in PR #14730:
URL: https://github.com/apache/pinot/pull/14730#discussion_r1899567284
##########
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:
Yeah even I am not 100% sure but my understanding is that while controller
is streaming log file from other instance its acting like a proxy and passing
the same stream to the client/caller. Right now controller is closing the
stream before client consumes it.
Maybe jersey is managing closing the stream as we don't handle it in
`/loggers/download` flow as well.
--
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]