You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Pavlin Radoslavov (JIRA)" <ji...@apache.org> on 2011/05/29 23:27:47 UTC

[jira] [Created] (THRIFT-1184) event_base memory freeing by class TNonblockingServer

event_base memory freeing by class TNonblockingServer
-----------------------------------------------------

                 Key: THRIFT-1184
                 URL: https://issues.apache.org/jira/browse/THRIFT-1184
             Project: Thrift
          Issue Type: Bug
          Components: C++ - Library
            Reporter: Pavlin Radoslavov


The TNonblockingServer::eventBase_ pointer is assigned
by method TNonblockingServer::registerEvents()
so the libevent events are added to the proper libevent event base.

Currently the TNonblockingServer destructor unconditionally
calls event_base_free(eventBase_) to free the eventBase_ memory.

In certain cases the libevent event base might be allocated and
deallocated by a third-party software that uses Thrift, so it is
not appropriate for the TNonblockingServer destructor to unconditionally
call event_base_free(eventBase_).

Please see attached patch for a possible solution:
add an optional bool argument to method TNonblockingServer::registerEvents():
the value of that flag controls whether the TNonblockingServer destructor
should call event_base_free(eventBase_).

The argument is optional, and defaults to true (i.e, event_base_free(eventBase_)
is called) for API (and behavior) backward compatibility.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (THRIFT-1184) event_base memory freeing by class TNonblockingServer

Posted by "Nevo Hed (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055730#comment-13055730 ] 

Nevo Hed commented on THRIFT-1184:
----------------------------------

+1 I think the feature of running TNonBlocking on an existing event_base is an important one, if there are any users that run this in a scenario that is not run-forever then this would be a show-stopper for them

> event_base memory freeing by class TNonblockingServer
> -----------------------------------------------------
>
>                 Key: THRIFT-1184
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1184
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>            Reporter: Pavlin Radoslavov
>              Labels: libevent
>         Attachments: thrift1184_eventbase_free.patch
>
>
> The TNonblockingServer::eventBase_ pointer is assigned
> by method TNonblockingServer::registerEvents()
> so the libevent events are added to the proper libevent event base.
> Currently the TNonblockingServer destructor unconditionally
> calls event_base_free(eventBase_) to free the eventBase_ memory.
> In certain cases the libevent event base might be allocated and
> deallocated by a third-party software that uses Thrift, so it is
> not appropriate for the TNonblockingServer destructor to unconditionally
> call event_base_free(eventBase_).
> Please see attached patch for a possible solution:
> add an optional bool argument to method TNonblockingServer::registerEvents():
> the value of that flag controls whether the TNonblockingServer destructor
> should call event_base_free(eventBase_).
> The argument is optional, and defaults to true (i.e, event_base_free(eventBase_)
> is called) for API (and behavior) backward compatibility.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1184) event_base memory freeing by class TNonblockingServer

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13078531#comment-13078531 ] 

Hudson commented on THRIFT-1184:
--------------------------------

Integrated in Thrift #209 (See [https://builds.apache.org/job/Thrift/209/])
    THRIFT-1184 event_base memory freeing by class TNonblockingServer
adds option to use existing event base
Patch: Pavlin Radoslavov

roger : http://svn.apache.org/viewvc/?view=rev&rev=1153307
Files : 
* /thrift/trunk/lib/cpp/src/server/TNonblockingServer.h
* /thrift/trunk/lib/cpp/src/server/TNonblockingServer.cpp


> event_base memory freeing by class TNonblockingServer
> -----------------------------------------------------
>
>                 Key: THRIFT-1184
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1184
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>            Reporter: Pavlin Radoslavov
>            Assignee: Pavlin Radoslavov
>              Labels: libevent
>         Attachments: thrift1184_eventbase_free.patch
>
>
> The TNonblockingServer::eventBase_ pointer is assigned
> by method TNonblockingServer::registerEvents()
> so the libevent events are added to the proper libevent event base.
> Currently the TNonblockingServer destructor unconditionally
> calls event_base_free(eventBase_) to free the eventBase_ memory.
> In certain cases the libevent event base might be allocated and
> deallocated by a third-party software that uses Thrift, so it is
> not appropriate for the TNonblockingServer destructor to unconditionally
> call event_base_free(eventBase_).
> Please see attached patch for a possible solution:
> add an optional bool argument to method TNonblockingServer::registerEvents():
> the value of that flag controls whether the TNonblockingServer destructor
> should call event_base_free(eventBase_).
> The argument is optional, and defaults to true (i.e, event_base_free(eventBase_)
> is called) for API (and behavior) backward compatibility.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (THRIFT-1184) event_base memory freeing by class TNonblockingServer

Posted by "Pavlin Radoslavov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1184?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavlin Radoslavov updated THRIFT-1184:
--------------------------------------

    Attachment: thrift1184_eventbase_free.patch

A patch to address the issue of freeing the event_base memory.


> event_base memory freeing by class TNonblockingServer
> -----------------------------------------------------
>
>                 Key: THRIFT-1184
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1184
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>            Reporter: Pavlin Radoslavov
>              Labels: libevent
>         Attachments: thrift1184_eventbase_free.patch
>
>
> The TNonblockingServer::eventBase_ pointer is assigned
> by method TNonblockingServer::registerEvents()
> so the libevent events are added to the proper libevent event base.
> Currently the TNonblockingServer destructor unconditionally
> calls event_base_free(eventBase_) to free the eventBase_ memory.
> In certain cases the libevent event base might be allocated and
> deallocated by a third-party software that uses Thrift, so it is
> not appropriate for the TNonblockingServer destructor to unconditionally
> call event_base_free(eventBase_).
> Please see attached patch for a possible solution:
> add an optional bool argument to method TNonblockingServer::registerEvents():
> the value of that flag controls whether the TNonblockingServer destructor
> should call event_base_free(eventBase_).
> The argument is optional, and defaults to true (i.e, event_base_free(eventBase_)
> is called) for API (and behavior) backward compatibility.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (THRIFT-1184) event_base memory freeing by class TNonblockingServer

Posted by "Roger Meier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1184?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roger Meier resolved THRIFT-1184.
---------------------------------

    Resolution: Fixed
      Assignee: Pavlin Radoslavov

This makes sense, Thanks Pavlin!
=> committed!

> event_base memory freeing by class TNonblockingServer
> -----------------------------------------------------
>
>                 Key: THRIFT-1184
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1184
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>            Reporter: Pavlin Radoslavov
>            Assignee: Pavlin Radoslavov
>              Labels: libevent
>         Attachments: thrift1184_eventbase_free.patch
>
>
> The TNonblockingServer::eventBase_ pointer is assigned
> by method TNonblockingServer::registerEvents()
> so the libevent events are added to the proper libevent event base.
> Currently the TNonblockingServer destructor unconditionally
> calls event_base_free(eventBase_) to free the eventBase_ memory.
> In certain cases the libevent event base might be allocated and
> deallocated by a third-party software that uses Thrift, so it is
> not appropriate for the TNonblockingServer destructor to unconditionally
> call event_base_free(eventBase_).
> Please see attached patch for a possible solution:
> add an optional bool argument to method TNonblockingServer::registerEvents():
> the value of that flag controls whether the TNonblockingServer destructor
> should call event_base_free(eventBase_).
> The argument is optional, and defaults to true (i.e, event_base_free(eventBase_)
> is called) for API (and behavior) backward compatibility.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira