xcx1r3 opened a new issue, #13243: URL: https://github.com/apache/iceberg/issues/13243
### Proposed Change Resource leaks are a critical concern in software development and system design. A resource leak occurs when a program allocates a system or limited resource (such as memory, file handles, network connections, or database connections) but fails to release it after its use is complete. Over time, these unreleased resources accumulate, leading to serious performance degradation, instability, and even system failure. I found some code that may be leaking resources. # leak1 `org.apache.iceberg.avro.AvroEncoderUtil#encode` DataOutputStream dataOut  While the underlying stream out (the ByteArrayOutputStream) will be closed automatically by the try-with-resources statement, this does not trigger the close() method of the DataOutputStream (dataOut) that wraps it # leak2 `org.apache.iceberg.flink.sink.shuffle.DataStatisticsSerializer#deserialize` Memory sketchMemory  no sketchMemory.close() call # leak3 `org.apache.iceberg.hadoop.HadoopFileIO#deleteFile` FileSystem fs  no close call # leak 4 `org.apache.iceberg.hadoop.HadoopFileIO#deletePrefix` FileSystem fs  no close call # leak 5 `org.apache.iceberg.hadoop.Util#blockLocations` FileSystem fs  no close call # Fix Use a `try-with-resources` statement to ensure the resource object is automatically closed ### Proposal document _No response_ ### Specifications - [ ] Table - [ ] View - [ ] REST - [ ] Puffin - [ ] Encryption - [x] Other -- 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]
