You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@iotdb.apache.org by "Bo Zhang (Jira)" <ji...@apache.org> on 2021/09/22 07:25:00 UTC

[jira] [Assigned] (IOTDB-1678) client-cpp session bug: can cause connection leak.

     [ https://issues.apache.org/jira/browse/IOTDB-1678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bo Zhang reassigned IOTDB-1678:
-------------------------------

    Assignee: Bo Zhang

> 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
>            Assignee: Bo Zhang
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.13.0, 0.12.3
>
>
> 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)