Skip to content

Commit 0d98fe7

Browse files
committed
chore: remove unnecessary WARN logs for send or receive timeouts
1 parent a169e10 commit 0d98fe7

3 files changed

Lines changed: 3 additions & 16 deletions

File tree

lib/ConsumerImpl.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,14 +1117,6 @@ Result ConsumerImpl::receiveHelper(Message& msg, int timeout) {
11171117
if (state_ != Ready) {
11181118
return ResultAlreadyClosed;
11191119
}
1120-
auto cnx = getCnx().lock();
1121-
if (cnx) {
1122-
LOG_WARN(getName() << " Receive timeout after " << timeout << " ms, connection: "
1123-
<< cnx->cnxString() << ", queue size: " << incomingMessages_.size());
1124-
} else {
1125-
LOG_WARN(getName() << " Receive timeout after " << timeout
1126-
<< " ms, no connection, queue size: " << incomingMessages_.size());
1127-
}
11281120
return ResultTimeout;
11291121
}
11301122
}

lib/MultiTopicsConsumerImpl.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -603,14 +603,6 @@ Result MultiTopicsConsumerImpl::receive(Message& msg, int timeout) {
603603
if (state_ != Ready) {
604604
return ResultAlreadyClosed;
605605
}
606-
auto cnx = getCnx().lock();
607-
if (cnx) {
608-
LOG_WARN(getName() << " Receive timeout after " << timeout << " ms, connection: "
609-
<< cnx->cnxString() << ", queue size: " << incomingMessages_.size());
610-
} else {
611-
LOG_WARN(getName() << " Receive timeout after " << timeout
612-
<< " ms, no connection, queue size: " << incomingMessages_.size());
613-
}
614606
return ResultTimeout;
615607
}
616608
}

lib/ProducerImpl.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,9 @@ void ProducerImpl::handleSendTimeout(const ASIO_ERROR& err) {
873873
}
874874

875875
lock.unlock();
876+
if (pendingMessages.empty()) {
877+
return;
878+
}
876879
auto cnx = getCnx().lock();
877880
if (cnx) {
878881
LOG_WARN(getName() << "Send timeout due to queueing delay, connection: " << cnx->cnxString()

0 commit comments

Comments
 (0)