You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ro...@apache.org on 2015/03/29 20:59:08 UTC
thrift git commit: THRIFT-2441 ccp: Cannot shutdown TThreadedServer
when clients are still connected
Repository: thrift
Updated Branches:
refs/heads/master 664dd0a01 -> 6fc2115e1
THRIFT-2441 ccp: Cannot shutdown TThreadedServer when clients are still connected
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/6fc2115e
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/6fc2115e
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/6fc2115e
Branch: refs/heads/master
Commit: 6fc2115e187e34101515aa0bb509d83549c157d0
Parents: 664dd0a
Author: Roger Meier <ro...@apache.org>
Authored: Sun Mar 29 20:56:04 2015 +0200
Committer: Roger Meier <ro...@apache.org>
Committed: Sun Mar 29 20:56:04 2015 +0200
----------------------------------------------------------------------
lib/cpp/src/thrift/server/TThreadedServer.cpp | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/6fc2115e/lib/cpp/src/thrift/server/TThreadedServer.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/server/TThreadedServer.cpp b/lib/cpp/src/thrift/server/TThreadedServer.cpp
index 929ed86..380f69c 100644
--- a/lib/cpp/src/thrift/server/TThreadedServer.cpp
+++ b/lib/cpp/src/thrift/server/TThreadedServer.cpp
@@ -55,6 +55,10 @@ public:
~Task() {}
+ void stop() {
+ input_->getTransport()->close();
+ }
+
void run() {
boost::shared_ptr<TServerEventHandler> eventHandler = server_.getEventHandler();
void* connectionContext = NULL;
@@ -236,6 +240,8 @@ void TThreadedServer::serve() {
}
try {
Synchronized s(tasksMonitor_);
+ for ( std::set<Task*>::iterator tIt = tasks_.begin(); tIt != tasks_.end(); ++tIt )
+ (*tIt)->stop();
while (!tasks_.empty()) {
tasksMonitor_.wait();
}