Mario Emmenlauer created THRIFT-5226:
----------------------------------------
Summary: Problem with Buffered Transport for .NET
Key: THRIFT-5226
URL: https://issues.apache.org/jira/browse/THRIFT-5226
Project: Thrift
Issue Type: Bug
Components: netstd - Library
Affects Versions: 0.13.0
Reporter: Mario Emmenlauer
I'm testing various combinations of protocols and transports in C#. Without a
transport layering, everything looks pretty good and I can use binary, compact
and json protocols as expected. But when I wrap the transport in a buffered
transport, it seems the buffer is running over-full after a while and I get the
following error in the client:
{code}
Test method threw exception:
Thrift.Transport.TTransportException: MaxMessageSize reached
Stack Trace:
at Thrift.Transport.TEndpointTransport.CountConsumedMessageBytes(Int64
numBytes) in
/home/user/Source/thrift/lib/netstd/Thrift/Transport/TEndpointTransport.cs:line
85
at Thrift.Transport.Client.TMemoryBufferTransport.ReadAsync(Byte[] buffer,
Int32 offset, Int32 length, CancellationToken cancellationToken) in
/home/user/Source/thrift/lib/netstd/Thrift/Transport/Client/TMemoryBufferTransport.cs:line
126
at Thrift.Transport.TBufferedTransport.ReadAsync(Byte[] buffer, Int32
offset, Int32 length, CancellationToken cancellationToken) in
/home/user/Source/thrift/lib/netstd/Thrift/Transport/Layered/TBufferedTransport.cs:line
101
at Thrift.Transport.TTransport.ReadAllAsync(Byte[] buffer, Int32 offset,
Int32 length, CancellationToken cancellationToken) in
/home/user/Source/thrift/lib/netstd/Thrift/Transport/TTransport.cs:line 134
at Thrift.Protocol.TBinaryProtocol.ReadBinaryAsync(CancellationToken
cancellationToken) in
/home/user/Source/thrift/lib/netstd/Thrift/Protocol/TBinaryProtocol.cs:line 399
at DemoAPI.DemoAPI.fetchDataResult.ReadAsync(TProtocol iprot,
CancellationToken cancellationToken) in
/home/user/Source/ThriftTestManaged/src/gen-netstd/DemoAPI/DemoAPI.cs:line 2268
[...]
{code}
The maximum transferred data size should be ~16MB, whereas the default
MaxMessageSize is larger than 100MB, so I assume the buffer should be big
enough to hold the message. There is only a single client connected to the
server, and the client is constantly polling data blocks from the server (just
a simple benchmark with random byte[] blocks of sizes between 1 Byte and 16 MB).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)