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

Java TFramedTransport calls write twice for each flush

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.6
    • 0.13.0
    • Java - Library
    • None

    Description

      Code calls two writes to the underlying transport per flush: one for the frame size and one for the payload. The result is that folks use TBufferedTransport on top of TFramedTransport to avoid getting two ethernet frames for small packets. This means everything is double-buffered!

      Based on THRIFT-1121 and THRIFT-959 this may have been an issue for a long time - the fix was easy however. We make room for the frame size before writing to the buffer, then we only have to pull out the buffer, drop the frame size into the 4 bytes that we pre-allocated, and then write to the underlying transport once.

      Attachments

        Issue Links

          Activity

            People

              jking3 James E. King III
              jking3 James E. King III
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m