massakam closed pull request #1062: Issue 1061: Consumers in failover 
subscription stops consuming after restart
URL: https://github.com/apache/incubator-pulsar/pull/1062
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherSingleActiveConsumer.java
 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherSingleActiveConsumer.java
index 68addac27..4e3fd00b5 100644
--- 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherSingleActiveConsumer.java
+++ 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherSingleActiveConsumer.java
@@ -238,6 +238,12 @@ public void redeliverUnacknowledgedMessages(Consumer 
consumer, List<PositionImpl
 
     @Override
     protected void readMoreEntries(Consumer consumer) {
+        // consumer can be null when all consumers are disconnected from 
broker.
+        // so skip reading more entries if currently there is no active 
consumer.
+        if (null == consumer) {
+            return;
+        }
+
         int availablePermits = consumer.getAvailablePermits();
 
         if (availablePermits > 0) {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to