Repository: thrift Updated Branches: refs/heads/master 43e959bc5 -> 257dceff5
THRIFT-4160 (pt. 2): Fix wrong numActiveProcessors_ when failing to notify any IO thread Client: cpp This closes #1239 We should decrease numActiveProcessors_ when failing to notify any IO thread. Project: http://git-wip-us.apache.org/repos/asf/thrift/repo Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/257dceff Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/257dceff Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/257dceff Branch: refs/heads/master Commit: 257dceff5ebeb083ecf5527d80e37aa9706e2d75 Parents: 43e959b Author: Changli Gao <[email protected]> Authored: Thu Apr 6 00:42:01 2017 +0800 Committer: James E. King, III <[email protected]> Committed: Wed Apr 5 19:29:24 2017 -0400 ---------------------------------------------------------------------- lib/cpp/src/thrift/server/TNonblockingServer.cpp | 2 ++ 1 file changed, 2 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/thrift/blob/257dceff/lib/cpp/src/thrift/server/TNonblockingServer.cpp ---------------------------------------------------------------------- diff --git a/lib/cpp/src/thrift/server/TNonblockingServer.cpp b/lib/cpp/src/thrift/server/TNonblockingServer.cpp index 905c5d2..97c4cd9 100644 --- a/lib/cpp/src/thrift/server/TNonblockingServer.cpp +++ b/lib/cpp/src/thrift/server/TNonblockingServer.cpp @@ -288,6 +288,7 @@ public: void forceClose() { appState_ = APP_CLOSE_CONNECTION; if (!notifyIOThread()) { + server_->decrementActiveProcessors(); close(); throw TException("TConnection::forceClose: failed write on notify pipe"); } @@ -349,6 +350,7 @@ public: // Signal completion back to the libevent thread via a pipe if (!connection_->notifyIOThread()) { GlobalOutput.printf("TNonblockingServer: failed to notifyIOThread, closing."); + connection_->server_->decrementActiveProcessors(); connection_->close(); throw TException("TNonblockingServer::Task::run: failed write on notify pipe"); }
