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

Iliya Gurov updated THRIFT-4201:
--------------------------------
    Description: 
Before we get more data by doing refill in the 
*THttpTransport::readMoreData()*, we need to check whether we have already the 
entire content in the buffer (fetched in the last *::recv* in *TSocket::read()* 
while processing the previous chunk). Doing refill without this check may lead 
to calling *::recv* even though all chunks (the entire content) are already in 
the buffer. The effect of this is that the call fails either with a false 
positive timeout or blocks in recv if no timeout is configured.

Attached is the suggested patch and tcpdump pcap (you can clearly see there 
that we wait for more data although we have already ACKed the last piece of 
byte - tcp.stream eq 26).


  was:
Before we get more data by doing refill in the 
*THttpTransport::readMoreData()*, we need to check whether we have already the 
entire content in the buffer (fetched in the last *::recv* in *TSocket::read()* 
while processing the previous chunk). Doing refill without this check may lead 
to calling *::recv* even though all chunks (the entire content) are already in 
the buffer. The effect of this is that the call fails either with a false 
positive timeout or blocks in recv if no timeout is configured.

Attached is the suggested patch and tcpdump pcap.



> False positive timeout or blocking recv in the THttpTransport client
> --------------------------------------------------------------------
>
>                 Key: THRIFT-4201
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4201
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.10.0
>            Reporter: Iliya Gurov
>              Labels: C++, C++11, client, http, patch, transport
>         Attachments: httpTransportClientPatch.patch
>
>
> Before we get more data by doing refill in the 
> *THttpTransport::readMoreData()*, we need to check whether we have already 
> the entire content in the buffer (fetched in the last *::recv* in 
> *TSocket::read()* while processing the previous chunk). Doing refill without 
> this check may lead to calling *::recv* even though all chunks (the entire 
> content) are already in the buffer. The effect of this is that the call fails 
> either with a false positive timeout or blocks in recv if no timeout is 
> configured.
> Attached is the suggested patch and tcpdump pcap (you can clearly see there 
> that we wait for more data although we have already ACKed the last piece of 
> byte - tcp.stream eq 26).



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

Reply via email to