Bo Zhang created IOTDB-1678:
-------------------------------
Summary: client-cpp session bug: can cause connection leak.
Key: IOTDB-1678
URL: https://issues.apache.org/jira/browse/IOTDB-1678
Project: Apache IoTDB
Issue Type: Bug
Components: Client/Others
Reporter: Bo Zhang
Fix For: 0.13.0
in file Session.h and Session.cpp
========================================
class Session {
...
std::shared_ptr <apache::thrift::transport::TSocket> transport;
}
void Session::open(bool enableRPCCompression, int connectionTimeoutInMs) {
...
shared_ptr <TTransport> transport(new TFramedTransport(socket)); //here,
wrongly create 1 new variable transport, and no code will call this local
variable transport->close() to release connection
}
void Session::close() {
if (transport != NULL) { //here, use Session.transport
transport->close();
}
}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)