jackylee-ch opened a new pull request, #9902:
URL: https://github.com/apache/paimon/pull/9902

   ### Purpose
   
   `getCompressionCodecByCompression` probes the codec by opening an output 
stream and discards it unclosed. Hadoop leases a `Compressor` from `CodecPool` 
for that stream and returns it only on `close()`, so every call orphaned one 
lease — once per data file, so a long-lived csv/json/text writer leaks 
steadily. A native compressor also keeps its `z_stream`, released only via 
`end()`. The probe is kept; it surfaces a missing native library at selection 
time.
   
   `AbstractTextFileWriter.close()` also drops a redundant `flush()`: `close()` 
already flushes, and since `SingleFileWriter` closes writer and stream 
separately, a throwing `flush()` lost the lease for good.
   
   ### Tests
   
   `HadoopCompressionUtilsTest#testCodecProbeDoesNotLeaseACompressor` asserts 
the leased count does not grow. `DEFLATE`, since 
`GzipCodec.getCompressorType()` is null without native zlib. Reverting the fix:
   
   ```
   expected: 1
    but was: 5
   ```
   
   `paimon-format`: 634 run, 0 failures.
   
   Written with Claude Code; verification is mine.
   


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

Reply via email to