Skip to content

Commit

Permalink
[ISSUE #134]Fixed ResponseFuture leak when invokeHeartBeat is failed. (
Browse files Browse the repository at this point in the history
  • Loading branch information
ifplusor authored and ShannonDing committed Apr 17, 2019
1 parent 28c4cf0 commit 68b323d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/transport/TcpRemotingClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 68b323d

Please sign in to comment.