From 782cc4e55a247bfb7e6d2f3e3301b8d93dad34bc Mon Sep 17 00:00:00 2001 From: Curtis Wan Date: Mon, 11 Sep 2023 16:40:22 +0800 Subject: [PATCH] refactor: clear cache when writer closes Signed-off-by: Curtis Wan --- .../src/main/scala/kafka/log/s3/operator/DefaultS3Operator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/scala/kafka/log/s3/operator/DefaultS3Operator.java b/core/src/main/scala/kafka/log/s3/operator/DefaultS3Operator.java index b34b432299..a62d9e8706 100644 --- a/core/src/main/scala/kafka/log/s3/operator/DefaultS3Operator.java +++ b/core/src/main/scala/kafka/log/s3/operator/DefaultS3Operator.java @@ -399,7 +399,7 @@ public CompletableFuture close() { // upload the cached buf anyway. Note that the last part can be smaller than minPartSize. if (cachedBuf != null) { handleWriteFuturePart(cachedBufLastAddCf, cachedBuf, System.nanoTime()); - cachedBuf = null; + clearCache(); } OBJECT_INTO_CLOSE_COST.update(System.nanoTime() - start);