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

BewareMyPower pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-client-cpp.git


The following commit(s) were added to refs/heads/main by this push:
     new 0dab2ba  chore: remove unnecessary WARN logs for send or receive 
timeouts (#584)
0dab2ba is described below

commit 0dab2ba7288264b29166a5f54acfed257169fa9c
Author: Yunze Xu <[email protected]>
AuthorDate: Mon Jun 1 18:05:18 2026 +0800

    chore: remove unnecessary WARN logs for send or receive timeouts (#584)
---
 lib/ConsumerImpl.cc            | 8 --------
 lib/MultiTopicsConsumerImpl.cc | 8 --------
 lib/ProducerImpl.cc            | 3 +++
 3 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/lib/ConsumerImpl.cc b/lib/ConsumerImpl.cc
index 1060cd5..e9ab7bd 100644
--- a/lib/ConsumerImpl.cc
+++ b/lib/ConsumerImpl.cc
@@ -1117,14 +1117,6 @@ Result ConsumerImpl::receiveHelper(Message& msg, int 
timeout) {
         if (state_ != Ready) {
             return ResultAlreadyClosed;
         }
-        auto cnx = getCnx().lock();
-        if (cnx) {
-            LOG_WARN(getName() << " Receive timeout after " << timeout << " 
ms, connection: "
-                               << cnx->cnxString() << ", queue size: " << 
incomingMessages_.size());
-        } else {
-            LOG_WARN(getName() << " Receive timeout after " << timeout
-                               << " ms, no connection, queue size: " << 
incomingMessages_.size());
-        }
         return ResultTimeout;
     }
 }
diff --git a/lib/MultiTopicsConsumerImpl.cc b/lib/MultiTopicsConsumerImpl.cc
index 5e1b517..4f5f9f7 100644
--- a/lib/MultiTopicsConsumerImpl.cc
+++ b/lib/MultiTopicsConsumerImpl.cc
@@ -603,14 +603,6 @@ Result MultiTopicsConsumerImpl::receive(Message& msg, int 
timeout) {
         if (state_ != Ready) {
             return ResultAlreadyClosed;
         }
-        auto cnx = getCnx().lock();
-        if (cnx) {
-            LOG_WARN(getName() << " Receive timeout after " << timeout << " 
ms, connection: "
-                               << cnx->cnxString() << ", queue size: " << 
incomingMessages_.size());
-        } else {
-            LOG_WARN(getName() << " Receive timeout after " << timeout
-                               << " ms, no connection, queue size: " << 
incomingMessages_.size());
-        }
         return ResultTimeout;
     }
 }
diff --git a/lib/ProducerImpl.cc b/lib/ProducerImpl.cc
index 873796d..4697e72 100644
--- a/lib/ProducerImpl.cc
+++ b/lib/ProducerImpl.cc
@@ -873,6 +873,9 @@ void ProducerImpl::handleSendTimeout(const ASIO_ERROR& err) 
{
     }
 
     lock.unlock();
+    if (pendingMessages.empty()) {
+        return;
+    }
     auto cnx = getCnx().lock();
     if (cnx) {
         LOG_WARN(getName() << "Send timeout due to queueing delay, connection: 
" << cnx->cnxString()

Reply via email to