Skip to content

Commit

Permalink
THRIFT-4161: TNonblockingServer: Fix using uninitialized event_
Browse files Browse the repository at this point in the history
Client: cpp

When there are more than one IO threads, and we have failed to notify
one IO threads, then we have to close the connection. But the event_
in that connection isn't initialized. We should use setIdle() instead.

This closes #1216
  • Loading branch information
xiaosuo authored and jeking3 committed Apr 3, 2017
1 parent d4fa706 commit bf42d55
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/cpp/src/thrift/server/TNonblockingServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,10 +821,7 @@ void TNonblockingServer::TConnection::setFlags(short eventFlags) {
* Closes a connection
*/
void TNonblockingServer::TConnection::close() {
if (eventFlags_ && event_del(&event_) == -1) {
GlobalOutput.perror("TConnection::close() event_del", THRIFT_GET_SOCKET_ERROR);
return;
}
setIdle();

if (serverEventHandler_) {
serverEventHandler_->deleteContext(connectionContext_, inputProtocol_, outputProtocol_);
Expand Down

0 comments on commit bf42d55

Please sign in to comment.