You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/12/03 01:35:03 UTC

[GitHub] [pulsar] congbobo184 commented on a change in pull request #13088: [Transaction] Add a check for uninitialized PendingAck

congbobo184 commented on a change in pull request #13088:
URL: https://github.com/apache/pulsar/pull/13088#discussion_r761586600



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/PendingAckHandleImpl.java
##########
@@ -937,6 +937,10 @@ public TransactionInPendingAckStats getTransactionInPendingAckStats(TxnID txnID)
         }
     }
 
+    public boolean checkIfPendingAckStoreInit() {
+        return pendingAckStoreFuture != null;

Review comment:
       add check `this.pendingAckStoreFuture.isDone()`

##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TransactionAggregator.java
##########
@@ -64,7 +64,8 @@ public static void generate(PulsarService pulsar, SimpleTextOutputStream stream,
                             topic.getSubscriptions().values().forEach(subscription -> {
                                 try {
                                     localManageLedgerStats.get().reset();
-                                    if (!checkTopicIsEventsNames(TopicName.get(subscription.getTopic().getName()))) {
+                                    if (!checkTopicIsEventsNames(TopicName.get(subscription.getTopic().getName()))
+                                            && ((PersistentSubscription) subscription).checkIfPendingAckStoreInit()) {

Review comment:
       we should judge subscription class




-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org