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

TFDTransport destructor should not throw

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.9
    • Fix Version/s: 0.9.2
    • Component/s: C++ - Library
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      Following the discussion on https://github.com/apache/thrift/pull/142 ~TFDTransport seems to be the only throwing destructor from all transports.
      Throwing from a destructor is considered not safe under certain conditions and should be avoided.

      The c++ standard defines a default noexcept for default destructors as mentioned in: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3166.html
      This will cause the current behavior to fail under C++11.

      In my opinion, we should catch this mentioned exception in the destructor and log it. This will require to explicitly call the close() method in order to catch the exception.

        Attachments

          Activity

            People

            • Assignee:
              henrique Henrique Mendonca
              Reporter:
              henrique Henrique Mendonca
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: