Apache thrift: client timeout issues Apache thrift: client timeout issues php php

Apache thrift: client timeout issues


The Thrift PHP library is a bit broken. You need to manually set the timeoutsE.g.

  $socket = new TSocket('host', 9095);  $socket->setSendTimeout(60000);  $socket->setRecvTimeout(60000)


This happens often with protocols that do not supply message length: a client sends more data then the server expects and waits for the server to receive the data. The server receives some of the data, tries to parse it and fails. Now the server-side of the protocol is in errorneous state. If it continues to read the data, it may block. Most probably, the server-side has sent you some error response and is waiting at the same time for the client to receive the response, but that will never happen too.

This is my guess. The best strategy IMHO is to set a time-out for both client and server sockets.