Skip to content

Commit

Permalink
chore(compaction): suppress error (#929)
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Han <[email protected]>
  • Loading branch information
superhx authored Feb 19, 2024
1 parent 41926bc commit 5b1cd92
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void compact() {
try {
compact0(false);
} catch (Throwable e) {
LOGGER.error("Failed to compact {} stream objects", stream.streamId(), e);
handleCompactException(e);
}
}

Expand All @@ -82,7 +82,15 @@ public void cleanup() {
try {
compact0(true);
} catch (Throwable e) {
LOGGER.error("Failed to compact {} stream objects", stream.streamId(), e);
handleCompactException(e);
}
}

private void handleCompactException(Throwable e) {
if (stream instanceof S3StreamClient.StreamWrapper && ((S3StreamClient.StreamWrapper) stream).isClosed()) {
LOGGER.warn("[STREAM_OBJECT_COMPACT_FAIL],[STREAM_CLOSED],{}", stream.streamId(), e);
} else {
LOGGER.error("[STREAM_OBJECT_COMPACT_FAIL],[UNEXPECTED],{}", stream.streamId(), e);
}
}

Expand Down

0 comments on commit 5b1cd92

Please sign in to comment.