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

Java - TFramedTransport won't allow max frame size larger than default max message size

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.14.0
    • None
    • Java - Library
    • None

    Description

      The constructor for the TFramedTransport.Factory allows directly specifying the max frame size. However, if the max frame size provided is larger than the default max message size, then the internal checks for the max message size will trigger a failure, even if the message is smaller than the max frame size that was specified.

      For reference, the default max frame size is 16MB, and the default max message size is 100MB. So, if you pass in a max frame size of 200MB to the factory, and then send a message of size 101MB, this will trigger the error.

      A proposed solution would be to have the TFramedTransport.Factory set the maximum message size at the same time it sets the max frame size on the underlying TConfiguration. I was thinking the max message size could be set to the same as the provided max frame size. However, I'm not exactly sure how the frame header size comes into play here, so maybe the max message size should be slightly larger to account for the frame header size bytes? So maybe the max message size should be set to either the larger of: the current value in TConfiguration, the default max message size, and the max frame size +4 bytes for the frame header? (and being careful not to exceed Integer.MAX_VALUE).

      This bug was introduced in 0.14.0 with THRIFT-5237's Java implementation.
      See also the issue reported in Apache Accumulo at https://github.com/apache/accumulo/issues/3731 and proposed workarounds on https://github.com/apache/accumulo/issues/3737

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ctubbsii Christopher Tubbs
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: