Organizational Research By

Surprising Reserch Topic

apache thrift client timeout issues using -'php,perl,thrift'

apache thrift client timeout issues  using -'php,perl,thrift'

I have some Apache Thrift (v.0.6.1) test application with perl-server and php-client.

The behaviour I cannot explain: If we call server-method with invalid argument we see the error in server-output, but php-client stays waiting the response infinitely.

Here are the sources of server:

sub new {
    my $classname = shift;
    my $self      = {};

    return bless($self,$classname);

sub DateToTimestamp
    my ($self, $date) = @_;
    my $result = CommonAPI::DateToTimestamp($date);
    return $result;

eval {
  my $handler       = new RPCHandler;
  my $processor     = new RPCPerformanceTest::RPCPerformanceTestProcessor($handler);
  my $serversocket  = new Thrift::ServerSocket(9091);
  my $forkingserver = new Thrift::ForkingServer($processor, $serversocket);
  print "Starting the server...\n";
  print "done.\n";
}; if ($@) {
  if ($@ =~ m/TException/ and exists $@->{message}) {
    my $message = $@->{message};
    my $code    = $@->{code};
    my $out     = $code . ':' . $message;
    die $out;
  } else {
    die $@;

and client:

try {

    $socket = new TSocket($server_host, $server_port);

    $transport = new TBufferedTransport($socket, 1024, 1024);
    $protocol = new TBinaryProtocol($transport);

    $client = new RPCPerformanceTestClient($protocol);

    $start = microtime(true);

    $result = $client->DateToTimestamp('071/26/2011 01:23:45');


} catch (Exception $e) {
    echo 'Exception: <b>' . $e->getMessage() . '</b>';

Why is this happening? Is it my fault? Is it expected behavour?

asked Sep 7, 2015 by rajesh
0 votes

Related Hot Questions

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.