danielcweeks commented on code in PR #14329:
URL: https://github.com/apache/iceberg/pull/14329#discussion_r2430050574


##########
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) {

Review Comment:
   Rather than adding the length check here, which adds extra requests when 
length isn't provided, why can't we just removed the `stream.read()` check here 
and quietly swallow errors on the abort path?  I'm not sure we really need to 
validate the stream isn't consumed to abort.  Even then, we can just ignore the 
exception since it's effectively closed at that point.



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