merlimat commented on a change in pull request #11068:
URL: https://github.com/apache/pulsar/pull/11068#discussion_r657789798
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TransactionAggregator.java
##########
@@ -67,7 +68,11 @@ public static void generate(PulsarService pulsar,
SimpleTextOutputStream stream,
generateManageLedgerStats(managedLedger,
stream, cluster, namespace, name,
subscription.getName());
} catch (Exception e) {
- log.warn("Transaction pending ack generate
managedLedgerStats fail!", e);
+ if (e.getCause() instanceof
BrokerServiceException.NotAllowedException) {
Review comment:
Instead of throwing exception which has a high cost (since it has to
generate the entire stack trace), we could change the method to return
`CompletableFuture<Optional<ManagedLedger>>` instead
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]