coderzc commented on code in PR #20075:
URL: https://github.com/apache/pulsar/pull/20075#discussion_r1164798346


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:
##########
@@ -1101,9 +1101,13 @@ public CompletableFuture<Void> clearDelayedMessages() {
         if (delayedDeliveryTracker.isEmpty() && topic.getBrokerService()
                 .getDelayedDeliveryTrackerFactory() instanceof 
BucketDelayedDeliveryTrackerFactory) {
             synchronized (this) {
-                if (delayedDeliveryTracker.isEmpty()) {
-                    delayedDeliveryTracker = Optional
-                            
.of(topic.getBrokerService().getDelayedDeliveryTrackerFactory().newTracker(this));
+                try {
+                    if (delayedDeliveryTracker.isEmpty()) {
+                        delayedDeliveryTracker = Optional
+                                
.of(topic.getBrokerService().getDelayedDeliveryTrackerFactory().newTracker(this));

Review Comment:
   You are right,I think we shoulud use another way to clean up data to avoid 
unnecessary recover,such as add a clean method in the factory.



-- 
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]

Reply via email to