nastra commented on code in PR #9998: URL: https://github.com/apache/iceberg/pull/9998#discussion_r1535162433
########## core/src/main/java/org/apache/iceberg/hadoop/HadoopStreams.java: ########## @@ -187,6 +187,16 @@ public void flush() throws IOException { public void close() throws IOException { stream.close(); this.closed = true; + // {@link org.apache.hadoop.fs.s3a.S3ABlockOutputStream#close()} calls {@link + // org.apache.hadoop.fs.s3a.S3ABlockOutputStream#putObject()} + // which doesn't throw an exception when interrupted. + // Need to check the interrupted flag to detect failed object upload + // and propagate the error up. + if (Thread.interrupted() + && "org.apache.hadoop.fs.s3a.S3ABlockOutputStream" + .equals(stream.getWrappedStream().getClass().getName())) { + throw new IOException("Failed to close stream as object failed to upload."); Review Comment: is the error msg accurate? technically the stream was closed (L118) but we just failed to upload the object. So maybe this should be updated to `Failed to upload object after stream was closed` or to `S3ABlockOutputStream failed to upload object after stream was closed`? -- 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