Skip to content

THRIFT-6459: Return a buffered transport from TBufferedTransportImpl.TFactory - #4060

Merged
Jens-G merged 1 commit into
apache:masterfrom
Jens-G:THRIFT-6459
Oct 28, 2026
Merged

Jens-G merged 1 commit into
apache:masterfrom
Jens-G:THRIFT-6459

Conversation

@Jens-G

@Jens-G Jens-G commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

THRIFT-6459

TBufferedTransportImpl.TFactory.GetTransport() created a TFramedTransportImpl, so a server, TSerializer or TDeserializer set up with this factory read and wrote the framed format. It now obtains the transport's IStreamTransport interface with Supports() and creates a TBufferedTransportImpl over it.

A transport without that interface cannot carry a TBufferedTransportImpl, and the factory raises TTransportExceptionBadArgs for it. That includes a transport that is already buffered or framed. Returning such a transport unchanged would be the alternative, if that is preferred.

Everything set up with this factory changes from the framed to the unframed format, so the ticket may want the Breaking-Change label.

Tests, in lib/delphi/test/serializer/TestSerializer.Tests.pas:

  • The protocol conformity checks read the plain wire format of each protocol, and they now also run through the buffered transport factory. On master the framed transport takes the first four bytes as a frame length, and the read fails.
  • A new Test_TransportFactories checks that each factory returns the transport class it is named for, and that the buffered factory refuses a transport without a stream interface.

Built with Delphi XE (Win32), with no compiler errors, warnings or hints. TestSerializer.dpr in both states:

  • master with only this branch's test file: stops at the first buffered factory pair with TTransportExceptionNotOpen: Cannot read, Remote side has closed, because the framed transport takes the first four bytes as a frame length;
  • this branch: all factory pairs pass, and so do Test_TransportFactories, Test_COM_Types, Test_ThriftBytesCTORs and Test_Equal.

In a throwaway build that skipped the serializer round trips, Test_TransportFactories alone also failed on master, at the check of the class the buffered factory returns.

  • Apache Jira ticket: THRIFT-6459
  • Single commit
  • Code change, so the commit carries no CI-skip marker.

🤖 Generated with Claude Code

…TFactory

Client: delphi

TBufferedTransportImpl.TFactory.GetTransport() created a
TFramedTransportImpl, so a server, TSerializer or TDeserializer set up
with this factory read and wrote the framed format. It now creates a
TBufferedTransportImpl over the transport's IStreamTransport interface
and raises TTransportExceptionBadArgs for a transport that does not
offer one.

The serializer test now also runs the protocol conformity checks, which
read the plain wire format, through the buffered transport factory, and
a new test checks the transport classes that both factories return.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mergeable mergeable Bot added the delphi label Oct 28, 2026
@Jens-G
Jens-G marked this pull request as ready for review October 28, 2026 22:35
@Jens-G
Jens-G merged commit 35a07ef into apache:master Oct 28, 2026
110 checks passed
@Jens-G
Jens-G deleted the THRIFT-6459 branch October 28, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant