poorbarcode commented on code in PR #25915:
URL: https://github.com/apache/pulsar/pull/25915#discussion_r3342448176


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractTopic.java:
##########
@@ -665,13 +665,19 @@ protected Consumer getActiveConsumer(Subscription 
subscription) {
         return null;
     }
 
-    protected boolean hasLocalProducers() {
+    protected boolean hasProducersActive() {
         if (producers.isEmpty()) {
             return false;
         }
         for (Producer producer : producers.values()) {
             if (!producer.isRemote()) {
                 return true;
+            } else {
+                // If the remote producer still replicating messages, do not 
delete the topic.
+                if (System.currentTimeMillis() - 
producer.getLatestPublishTime() < (brokerService.getPulsar()
+                        
.getConfig().getBrokerReplicationInactiveThresholdSeconds() * 1000)) {

Review Comment:
   Thanks , correct the code



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