jackye1995 commented on code in PR #7262:
URL: https://github.com/apache/iceberg/pull/7262#discussion_r1156493085


##########
aws/src/main/java/org/apache/iceberg/aws/s3/S3InputStream.java:
##########
@@ -194,9 +195,28 @@ private void openStream() throws IOException {
     }
   }
 
-  private void closeStream() throws IOException {
+  private void closeStream() {
     if (stream != null) {
-      stream.close();
+      // if we aren't at the end of the stream, and the stream is abortable, 
then
+      // call abort() so we don't read the remaining data with the Apache HTTP 
client
+      abortStream();
+      try {
+        stream.close();
+      } catch (Exception e) {
+        // close quietly, closing an aborted stream will throw a content length

Review Comment:
   Sorry I guess I did not express it clearly. What I meant was that, can we 
check for the exception that if it is a content length check exception then we 
can skip, otherwise we log a warning?



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to