poorbarcode commented on code in PR #20075:
URL: https://github.com/apache/pulsar/pull/20075#discussion_r1164435184
##########
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:
> Because the dispatcher was closed before unsubscribe was called, this lead
to the tracker reference being lost, so we need to reinitialize the tracker to
clean up residual persistent data.
I see. Another question: the method `new tracker` will call `recover`
internally, right? If yes, I feel it is an expensive task. Can we only set the
Tracker to an unavailable state when closing the dispatcher to avoid recover
the second time?
--
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]