python - thrift timeout for long run call: thrift.transport.TTransport.TTransportException: TSocket read 0 bytes -


i've build rpc service using thrift. may run long time (minutes hours) each call. i've set thrift timeout 2 days.

transport = tsocket.tsocket(self.__host, self.__port) transport.settimeout(2 * 24 * 60 * 60 * 1000) 

but thrift closes connection after 600s, following exception:

thrift.transport.ttransport.ttransportexception: tsocket read 0 bytes 

is there's other timeout should set? (python, thrift server: windows; client: ubuntu)

the thrift transport connection being disconnected. due network issues or remote service restart or time out issues. whenever call made after disconnect results in ttransportexception. problem can solved reconnecting remote service. try using this, invoking before making remote service call.

def repoen_transport():     try:         if not transport.isopen():             transport.open()     except exception, msg:         print >> sys.stderr.write("error reopening transport {}".format(msg)) 

Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -