diff --git a/clients/src/main/java/org/apache/kafka/common/record/Record.java b/clients/src/main/java/org/apache/kafka/common/record/Record.java index baab9ab6f1c..77e4f68e649 100644 --- a/clients/src/main/java/org/apache/kafka/common/record/Record.java +++ b/clients/src/main/java/org/apache/kafka/common/record/Record.java @@ -147,7 +147,11 @@ public final class Record { // construct the compressor with compression type none since this function will not do any //compression according to the input type, it will just write the record's payload as is Compressor compressor = new Compressor(buffer, CompressionType.NONE); - compressor.putRecord(timestamp, key, value, type, valueOffset, valueSize); + try { + compressor.putRecord(timestamp, key, value, type, valueOffset, valueSize); + } finally { + compressor.close(); + } } public static void write(Compressor compressor, long crc, byte attributes, long timestamp, byte[] key, byte[] value, int valueOffset, int valueSize) { diff --git a/docs/upgrade.html b/docs/upgrade.html index 3e07ef89628..a6754bcb6e9 100644 --- a/docs/upgrade.html +++ b/docs/upgrade.html @@ -91,7 +91,7 @@ work with 0.10.0.x brokers. Therefore, 0.9.0.0 clients should be upgraded to 0.9