praveenc7 commented on code in PR #16379:
URL: https://github.com/apache/pinot/pull/16379#discussion_r2214865373
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentUploadDownloadRestletResource.java:
##########
@@ -199,7 +199,20 @@ public Response downloadSegment(
"Segment " + segmentName + " or table " + tableName + " not found
in " + segmentFile.getAbsolutePath(),
Response.Status.NOT_FOUND);
}
- builder.entity(segmentFile);
Review Comment:
Using builder.entity(segmentFile) registers the file with the JAX-RS
response builder, but the actual streaming is handled internally by Jersey.
This means we have no control over the output stream lifecycle and cannot
accurately emit metrics after the download completes. To address this, we
replaced it with a StreamingOutput wrapper that explicitly controls the file
transfer and ensures download duration and size metrics are recorded once the
file is fully sent to the client.
--
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]