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


##########
aws/src/main/java/org/apache/iceberg/aws/s3/S3OutputStream.java:
##########
@@ -407,6 +407,9 @@ private void cleanUpStagingFiles() {
         .suppressFailureWhenFinished()
         .onFailure((file, thrown) -> LOG.warn("Failed to delete staging file: 
{}", file, thrown))
         .run(File::delete);
+    // clear staging files and multipart map
+    stagingFiles.clear();
+    multiPartMap.clear();

Review Comment:
   I don't think there's any harm in clearing these eagerly, but I'd agree with 
@singhpk234 that this isn't practically going to help.  The output stream is 
bound to a single file write and these references will be kept as long as the 
stream is open regardless.  So the only narrow scenario where you get some 
benefit is if something is holding onto the output stream references even after 
they're closed (which is odd in practice).
   
   This isn't a leak and I question the validity of the examples.  The memory 
will be held when writing, but released when closed and dereferenced.



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