You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "danielcweeks (via GitHub)" <gi...@apache.org> on 2023/04/02 16:45:33 UTC

[GitHub] [iceberg] danielcweeks commented on a diff in pull request #7262: AWS: abort S3 input stream on close if not EOS

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


##########
aws/src/main/java/org/apache/iceberg/aws/s3/S3InputStream.java:
##########
@@ -194,9 +195,27 @@ 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
+      abortStream();
+      try {
+        stream.close();
+      } catch (Exception e) {
+        // close quietly

Review Comment:
   We might want to log the underlying reason as info or warn here, just so we don't silently swallow issues that may come up.



-- 
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-unsubscribe@iceberg.apache.org

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


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