Handle unchecked exceptions on cursor to ensure read callback is triggered
@@ -137,14 +137,17 @@ class OpReadEntry implements ReadEntriesCallback {
}));
} else {
// The reading was already completed, release resources and trigger callback
+ try {
cursor.readOperationCompleted();
+ } finally {
cursor.ledger.getExecutor().executeOrdered(cursor.ledger.getName(), safeRun(() -> {
callback.readEntriesComplete(entries, ctx);
recycle();
}));
}
}
+ }
public int getNumberOfEntriesToRead() {
return count - entries.size();
