diff --git a/s3stream/src/main/java/com/automq/stream/s3/S3Stream.java b/s3stream/src/main/java/com/automq/stream/s3/S3Stream.java index f08439f875..168542a4a5 100644 --- a/s3stream/src/main/java/com/automq/stream/s3/S3Stream.java +++ b/s3stream/src/main/java/com/automq/stream/s3/S3Stream.java @@ -162,12 +162,11 @@ public CompletableFuture append(AppendContext context, RecordBatch }, LOGGER, "append"); pendingAppends.add(cf); pendingAppendTimestamps.push(startTimeNanos); - cf.whenComplete((nil, ex) -> { + return cf.whenComplete((nil, ex) -> { StreamOperationStats.getInstance().appendStreamLatency.record(TimerUtil.durationElapsedAs(startTimeNanos, TimeUnit.NANOSECONDS)); pendingAppends.remove(cf); pendingAppendTimestamps.pop(); }); - return cf; } finally { readLock.unlock(); }