diff --git a/s3stream/src/main/java/com/automq/stream/s3/wal/impl/block/SlidingWindowService.java b/s3stream/src/main/java/com/automq/stream/s3/wal/impl/block/SlidingWindowService.java index f138ae55d2..f58fbd147c 100644 --- a/s3stream/src/main/java/com/automq/stream/s3/wal/impl/block/SlidingWindowService.java +++ b/s3stream/src/main/java/com/automq/stream/s3/wal/impl/block/SlidingWindowService.java @@ -64,8 +64,10 @@ public class SlidingWindowService { * The lock of {@link #pendingBlocks}, {@link #writingBlocks}, {@link #currentBlock}. */ private final Lock blockLock = new ReentrantLock(); - - private final Lock pollBlocKLock = new ReentrantLock(); + /** + * The lock of {@link #pendingBlocks}. + */ + private final Lock pollBlockLock = new ReentrantLock(); /** * Blocks that are being written. */ @@ -280,11 +282,11 @@ private Block nextBlock(Block previousBlock) { * Get all blocks to be written. If there is no non-empty block, return null. */ private BlockBatch pollBlocks() { - if (this.pollBlocKLock.tryLock()) { + if (this.pollBlockLock.tryLock()) { try { return pollBlocksLocked(); } finally { - this.pollBlocKLock.unlock(); + this.pollBlockLock.unlock(); } } return null; @@ -292,7 +294,7 @@ private BlockBatch pollBlocks() { /** * Get all blocks to be written. If there is no non-empty block, return null. - * Note: this method is NOT thread safe, and it should be called with {@link #blockLock} locked. + * Note: this method is NOT thread safe, and it should be called with {@link #pollBlockLock} locked. */ private BlockBatch pollBlocksLocked() { Block currentBlock = this.currentBlock;