stubz151 commented on code in PR #14329:
URL: https://github.com/apache/iceberg/pull/14329#discussion_r2429515159
##########
aws/src/main/java/org/apache/iceberg/aws/s3/S3InputStream.java:
##########
@@ -278,14 +289,18 @@ private void closeStream(boolean closeQuietly) throws
IOException {
private void abortStream() {
try {
- if (stream instanceof Abortable && stream.read() != -1) {
+ if (stream instanceof Abortable && remainingInCurrentRequest() > 0) {
((Abortable) stream).abort();
}
} catch (Exception e) {
LOG.warn("An error occurred while aborting the stream", e);
}
}
+ private long remainingInCurrentRequest() {
Review Comment:
[nit] remainingInCurrentRequest should be bytesRemainingInCurrentRequest
--
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]