I think I've heard of this problem before, and I think the fix was to turn on keep alive. I don't think there are existing hooks for that in thrift though. Turning on keepalive should also make your clients throw an exception much faster than one hour.
From: Vivek Goel <[email protected]> To: [email protected], Date: 03/13/2013 01:50 PM Subject: Recv timeout not working I am using thrift C++ library at both end server and client. I am facing problem with recv timeout. I am setting a one hour value for recv timeout. But it is not working, clients are infinitely waiting on server restart. My code is: ---------------------------------------------------------------------------------------- boost::shared_ptr<TSocket> socket = boost::shared_ptr<TSocket>( new TSocket(server_host_, server_port_)); socket->setConnTimeout(ThriftConf::connection_timeout_); socket->setRecvTimeout(ThriftConf::recv_timeout_); socket->setSendTimeout(ThriftConf::send_timeout_); boost::shared_ptr<TTransport> tr = boost::shared_ptr<TBufferedTransport>( new TBufferedTransport(socket)); boost::shared_ptr<TBinaryProtocol> p = boost::shared_ptr<TBinaryProtocol>( new TBinaryProtocol(tr)); ---------------------------------------------------------------------------------------------------- Where values are: (gdb) print ThriftConf::connection_timeout_ $1 = 360000 (gdb) print ThriftConf::recv_timeout_ $2 = 3600000 (gdb) print ThriftConf::send_timeout_ $3 = 180000 regards Vivek Goel
