You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by zh...@apache.org on 2020/03/13 06:10:56 UTC

[pulsar] 15/17: Avoid calling ConsumerImpl::redeliverMessages() when message list is empty (#6480)

This is an automated email from the ASF dual-hosted git repository.

zhaijia pushed a commit to branch branch-2.5
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit de174aa0458f3fc3cfb001cd864feebffb023d61
Author: Matteo Merli <mm...@apache.org>
AuthorDate: Thu Mar 5 15:13:38 2020 -0800

    Avoid calling ConsumerImpl::redeliverMessages() when message list is empty (#6480)
    
    (cherry picked from commit 6604f540995d8bb674bfe2eb50cdb2802a0b7cec)
---
 pulsar-client-cpp/lib/NegativeAcksTracker.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pulsar-client-cpp/lib/NegativeAcksTracker.cc b/pulsar-client-cpp/lib/NegativeAcksTracker.cc
index 492e379..202c5e4 100644
--- a/pulsar-client-cpp/lib/NegativeAcksTracker.cc
+++ b/pulsar-client-cpp/lib/NegativeAcksTracker.cc
@@ -74,7 +74,9 @@ void NegativeAcksTracker::handleTimer(const boost::system::error_code &ec) {
         }
     }
 
-    consumer_.redeliverMessages(messagesToRedeliver);
+    if (!messagesToRedeliver.empty()) {
+        consumer_.redeliverMessages(messagesToRedeliver);
+    }
     scheduleTimer();
 }