rocketmq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ding...@apache.org
Subject [rocketmq-client-cpp] branch master updated: [ISSUE #134]Fixed ResponseFuture leak when invokeHeartBeat is failed. (#135)
Date Wed, 17 Apr 2019 02:48:54 GMT
This is an automated email from the ASF dual-hosted git repository.

dinglei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-cpp.git


The following commit(s) were added to refs/heads/master by this push:
     new 68b323d  [ISSUE #134]Fixed ResponseFuture leak when invokeHeartBeat is failed. (#135)
68b323d is described below

commit 68b323ded2433a916f3c452be8ddecb0be38ab4b
Author: James <ywhjames@hotmail.com>
AuthorDate: Wed Apr 17 10:48:50 2019 +0800

    [ISSUE #134]Fixed ResponseFuture leak when invokeHeartBeat is failed. (#135)
---
 src/transport/TcpRemotingClient.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/transport/TcpRemotingClient.cpp b/src/transport/TcpRemotingClient.cpp
index e72af1d..8151379 100644
--- a/src/transport/TcpRemotingClient.cpp
+++ b/src/transport/TcpRemotingClient.cpp
@@ -142,12 +142,14 @@ bool TcpRemotingClient::invokeHeartBeat(const string& addr, RemotingCommand&
req
       unique_ptr<RemotingCommand> pRsp(responseFuture->waitResponse(3000));
       if (pRsp == NULL) {
         LOG_ERROR("wait response timeout of heartbeat, so closeTransport of addr:%s", addr.c_str());
+        findAndDeleteResponseFuture(opaque);
         CloseTransport(addr, pTcp);
         return false;
       } else if (pRsp->getCode() == SUCCESS_VALUE) {
         return true;
       } else {
         LOG_WARN("get error response:%d of heartbeat to addr:%s", pRsp->getCode(), addr.c_str());
+        findAndDeleteResponseFuture(opaque);
         return false;
       }
     } else {


Mime
View raw message