[ 
https://issues.apache.org/jira/browse/THRIFT-5636?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sergey Yelin updated THRIFT-5636:
---------------------------------
    Description: 
It looks like erlang tests are broken since this 
[fix|https://github.com/kpy3/thrift/commit/22f6a8a3c879175e18ce95f88a393f34ff8f158c].

Now some of read tests for {{thrift_socket_transport}} module fail because of 
timeout while waiting data from the mocked {{gen_tcp:recv/3}} call (because of 
infinite loop in {{thrift_socket_transport:loop_recv/3}}). 

 In production calling to {{thrift_socket_transport:read/2}} will lead to 
infinite loop if remote server stop sending data to socket or received data 
size is less than requested.

It looks like {{gen_tcp:recv/3}} should not try to receive all data from socket 
(passing 0 to call), but set some reasonable value and get data by chunks, 
passing control to client.

  was:
It looks like erlang tests are broken since this 
[fix|https://github.com/kpy3/thrift/commit/22f6a8a3c879175e18ce95f88a393f34ff8f158c].

Now some of read tests for `thrift_socket_transport` module fail because of 
timeout while waiting data from the mocked `gen_tcp:recv/3` call (because of 
infinite loop in `thrift_socket_transport/loop_recv/3`). 

 In production calling to `thrift_socket_transport:read/2` will lead to 
infinite loop if remote server stop sending data to socket or received data 
size is less than requested.

It looks like `gen_tcp:recv/3` should not try to receive all data from socket 
(passing 0 to call), but set some reasonable value and get data by chunks, 
passing control to client.


> Broken tests in erlang client library
> -------------------------------------
>
>                 Key: THRIFT-5636
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5636
>             Project: Thrift
>          Issue Type: Bug
>          Components: Erlang - Library
>    Affects Versions: 0.17.0
>            Reporter: Sergey Yelin
>            Priority: Major
>
> It looks like erlang tests are broken since this 
> [fix|https://github.com/kpy3/thrift/commit/22f6a8a3c879175e18ce95f88a393f34ff8f158c].
> Now some of read tests for {{thrift_socket_transport}} module fail because of 
> timeout while waiting data from the mocked {{gen_tcp:recv/3}} call (because 
> of infinite loop in {{thrift_socket_transport:loop_recv/3}}). 
>  In production calling to {{thrift_socket_transport:read/2}} will lead to 
> infinite loop if remote server stop sending data to socket or received data 
> size is less than requested.
> It looks like {{gen_tcp:recv/3}} should not try to receive all data from 
> socket (passing 0 to call), but set some reasonable value and get data by 
> chunks, passing control to client.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to