Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-732

server exits abnormally when client calls send_xxx function without calling recv_xxx function

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 0.2
    • Fix Version/s: 0.10.0
    • Component/s: C++ - Compiler
    • Labels:
      None
    • Environment:

      MacOS SnowLeopard

      Description

      TNonblockingServer exits abnormally when client calls send_xxx function without recv_xxx function.

      The following code can reproduce the issue,

      #include <stdlib.h>
      #include <stdio.h>
      #include <iostream>
      #include "aggregator.h"
      #include <protocol/TBinaryProtocol.h>
      #include <transport/TSocket.h>
      #include <transport/TBufferTransports.h>

      using namespace apache::thrift;
      using namespace apache::thrift::protocol;
      using namespace apache::thrift::transport;
      //using namespace apache::thrift::concurrency;

      using boost::shared_ptr;

      int main(int argc, const char *argv[]) {
      shared_ptr<TSocket> socket(new TSocket("localhost", 9090));
      shared_ptr<TFramedTransport> framedtransport(new TFramedTransport(socket));
      shared_ptr<TProtocol> protocol(new TBinaryProtocol(framedtransport));
      aggregatorClient client(protocol);

      try

      { framedtransport->open(); }

      catch (TTransportException e)

      { std::cout << "transport exception" << std::endl; return 1; }

      catch (TException e2)

      { std::cout << "exception" << std::endl; }

      UserProfile profile;
      client.send_retrieve(1);

      framedtransport->close();

      return 0;
      }

        Attachments

        1. aggregator_server.cpp
          2 kB
          Eric Lam
        2. leaf.cpp
          1 kB
          Eric Lam

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              cpegeric Eric Lam
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: