Skip to content

Commit

Permalink
feat(s3stream): add logs on completion of timeout read request (#1227)
Browse files Browse the repository at this point in the history
Signed-off-by: Shichao Nie <[email protected]>
  • Loading branch information
SCNieh authored May 8, 2024
1 parent 2c37dc5 commit dca7c06
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion s3stream/src/main/java/com/automq/stream/s3/S3Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ private CompletableFuture<ReadDataBlock> read0(FetchContext context,
}
return new ReadDataBlock(rst, blockCacheRst.getCacheAccessType());
}).whenComplete((rst, ex) -> {
timeout.cancel();
handleTimeout(timeout, streamId, startOffset, finalEndOffset, maxBytes);
if (ex != null) {
LOGGER.error("read from block cache failed, stream={}, {}-{}, maxBytes: {}",
streamId, startOffset, finalEndOffset, maxBytes, ex);
Expand All @@ -492,6 +492,15 @@ private CompletableFuture<ReadDataBlock> read0(FetchContext context,
});
}

private void handleTimeout(Timeout timeout, long streamId, long startOffset, long finalEndOffset, int maxBytes) {
if (timeout.isExpired()) {
LOGGER.error("[POTENTIAL_BUG_RECOVERED] read from block cache completed, stream={}, [{},{}), maxBytes: {}",
streamId, startOffset, finalEndOffset, maxBytes);
} else {
timeout.cancel();
}
}

private void continuousCheck(List<StreamRecordBatch> records) {
long expectStartOffset = -1L;
for (StreamRecordBatch record : records) {
Expand Down

0 comments on commit dca7c06

Please sign in to comment.