[ 
https://issues.apache.org/jira/browse/THRIFT-4187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15992714#comment-15992714
 ] 

Allen George commented on THRIFT-4187:
--------------------------------------

Yeah - the Dart client is definitely at fault. I think it's because it's 
layering a blocking-style API onto an event-driven system without actually 
blocking. Basically, the sequence of events is as follows:

# Dart socket receives data
# Handler invoked, socket data placed into transport read buffer
# Thrift code makes read call
# Framed transport code reads header (i.e. message size)
# Framed transport code *immediately* reads message body; if [none is 
available|https://github.com/apache/thrift/blob/0.10.0/lib/dart/lib/src/transport/t_transport.dart#L46]
 (i.e. bytes are 0) it assumes remote side closed

Obviously the last point is false. The remote may be slow, or message sizes too 
small or what not. Just changing the linked line to `< 0` wouldn't help AFAICT 
because there's no way to indicate an error state in the current code. (NOTE: I 
may be wrong because I don't know Dart)

> Dart -> Rust Framed cross tests fail
> ------------------------------------
>
>                 Key: THRIFT-4187
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4187
>             Project: Thrift
>          Issue Type: Bug
>          Components: Rust - Library
>            Reporter: Allen George
>            Assignee: Allen George
>            Priority: Minor
>
> For some reason the Dart (client) -> Rust (server) framed-transport cross 
> tests fail. Initial investigation shows that *somehow* the dart client think 
> the socket was closed, which means it doesn't read the message from the 
> underlying transport.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to