Thrift
  1. Thrift
  2. THRIFT-1302

thrift: raise an exception if send() times out in

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.8
    • Component/s: C++ - Library
    • Labels:
      None

      Description

      From 1f76284b5972ab01d6f6ac68f96024a8066a3b59 Mon Sep 17 00:00:00 2001
      From: Adam Simpkins <simpkins@fb.com>
      Date: Fri, 16 Apr 2010 17:43:21 +0000
      Subject: [PATCH 22/33] thrift: raise an exception if send() times out in
      TSocket::write()

      Summary:
      Previously, if send() timed out in TSocket::write(), it would sleep for
      50 microseconds and retry. This essentially made the timeout set with
      setSendTimeout() useless. Now it raises a TTransportException on
      timeout.

      TNonblockingServer does use TSocket with the fd manually put in
      non-blocking mode, and that could cause EWOULDBLOCK and EAGAIN to occur
      during normal operation. However, it only uses write_partial() and
      never write(), so it should be safe to have write() throw the exception.

      Test Plan:
      Used the client and server in thrift/tutorial/cpp/async/sort/ to test
      sending a large message to the server. I set a 100ms timeout in the
      client, and verified that it correctly times out now if the server
      process is stopped.

      I also ran [fb unittests] to try and verify that this doesn't negatively
      affect any other code.

      Revert Plan:
      OK


      lib/cpp/src/transport/TSocket.cpp | 7 ++++---
      1 files changed, 4 insertions, 3 deletions

        Activity

        Bryan Duxbury made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Assignee Dave Watson [ davejwatson@fb ]
        Fix Version/s 0.8 [ 12316293 ]
        Resolution Fixed [ 1 ]
        Dave Watson made changes -
        Field Original Value New Value
        Attachment 0022-thrift-raise-an-exception-if-send-times-out-in-TSock.patch [ 12492086 ]
        Dave Watson created issue -

          People

          • Assignee:
            Dave Watson
            Reporter:
            Dave Watson
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development