@Override
public void readEntriesFailed(ManagedLedgerException status, Object ctx) {
cursor.readOperationCompleted();
if (!entries.isEmpty()) {
cursor.ledger.getExecutor().submit(safeRun(() -> {
callback.readEntriesComplete(entries, ctx);
recycle();
}));
} else {
if (!(status instanceof TooManyRequestsException)) {
log.warn("[{}][{}] read failed from ledger at position:{} : {}", cursor.ledger.getName(), cursor.getName(),
readPosition, status.getMessage());
} else {
if (log.isDebugEnabled()) {
log.debug("[{}][{}] read throttled failed from ledger at position:{}", cursor.ledger.getName(),
cursor.getName(), readPosition);
}
}
callback.readEntriesFailed(status, ctx);
cursor.ledger.mbean.recordReadEntriesError();
recycle();
}
}