Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
Patch Available
Description
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.
Attachments
Issue Links
- is related to
-
THRIFT-1442 TNonblockingServer: Refactor to allow multiple IO Threads
- Closed