Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,21 @@ static void truncateTable(Table table) throws IOException {
KeyValue<Object, Object> entry = tableIterator.next();
table.delete(entry.getKey());
}
} catch (Exception e) {
// Check if this is a closed database exception
if (e.getMessage() != null && e.getMessage().contains("closed")) {
// Log warning but don't fail if database is already closed
// This can happen during test cleanup or concurrent access scenarios
LOG.warn("Cannot truncate table {} - database is closed. " +
"Table may already be cleared or in process of being reinitialized.",
table.getName());
return;
}
// Re-throw other exceptions as they indicate real problems
if (e instanceof IOException) {
throw (IOException) e;
}
throw new IOException("Failed to truncate table " + table.getName(), e);
}
}

Expand Down
Loading