wenbingshen commented on code in PR #3683:
URL: https://github.com/apache/bookkeeper/pull/3683#discussion_r1039102570
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java:
##########
@@ -839,6 +839,10 @@ public void checkpoint(Checkpoint checkpoint) throws
IOException {
throw e;
} catch (RuntimeException e) {
recordFailedEvent(dbLedgerStorageStats.getFlushStats(), startTime);
+ // not wrap IOException again
+ if (e.getCause() != null && e.getCause() instanceof IOException) {
Review Comment:
@hangc0276 As long as I understand correctly, I believe `
writeCacheBeingFlushed forEach ` throws an `IOException` wrapped with a
`RuntimeException`:
```java
https://github.com/apache/bookkeeper/blob/master/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java#L782-L789
writeCacheBeingFlushed.forEach((ledgerId, entryId, entry) -> {
try {
long location = entryLogger.addEntry(ledgerId, entry);
entryLocationIndex.addLocation(batch, ledgerId, entryId,
location);
} catch (IOException e) {
throw new RuntimeException(e);
}
});
```
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java:
##########
@@ -839,6 +839,10 @@ public void checkpoint(Checkpoint checkpoint) throws
IOException {
throw e;
} catch (RuntimeException e) {
recordFailedEvent(dbLedgerStorageStats.getFlushStats(), startTime);
+ // not wrap IOException again
+ if (e.getCause() != null && e.getCause() instanceof IOException) {
Review Comment:
@hangc0276 As long as I understand correctly, I believe `
writeCacheBeingFlushed forEach ` throws an `IOException` wrapped with a
`RuntimeException`:
https://github.com/apache/bookkeeper/blob/master/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java#L782-L789
```java
writeCacheBeingFlushed.forEach((ledgerId, entryId, entry) -> {
try {
long location = entryLogger.addEntry(ledgerId, entry);
entryLocationIndex.addLocation(batch, ledgerId, entryId,
location);
} catch (IOException e) {
throw new RuntimeException(e);
}
});
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]