diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollectorThread.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollectorThread.java index 5126e79802b..25c42e8e4e6 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollectorThread.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollectorThread.java @@ -823,8 +823,13 @@ protected void extractMetaFromEntryLogs() throws EntryLogMetadataMapException { entryLogMetaMap.put(entryLogId, entryLogMeta); } } catch (IOException | RuntimeException e) { - LOG.warn("Premature exception when processing " + entryLogId - + " recovery will take care of the problem", e); + LOG.warn("Premature exception when processing {} recovery will take care of the problem", + entryLogId, e); + } catch (OutOfMemoryError oome) { + // somewhat similar to https://github.com/apache/bookkeeper/pull/3901 + // entrylog file can be corrupted but instead having a negative entry size + // it ends up with very large value for the entry size causing OODME + LOG.warn("OutOfMemoryError when processing {} - skipping the entry log", entryLogId, oome); } } }