You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Arya Goudarzi (JIRA)" <ji...@apache.org> on 2010/06/23 21:54:51 UTC

[jira] Issue Comment Edited: (THRIFT-638) BufferedTransport + C extensions block until recv timeout is reached on last fread call

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

Arya Goudarzi edited comment on THRIFT-638 at 6/23/10 3:53 PM:
---------------------------------------------------------------

At Gaia, we discovered this happens only when the streams don't contain exact multiples of buffer size, thus there could be cases where the length passed to read() would be larger than the actual data remained to be read from the stream. fread() would block till timeout when the length passed is larger than the actual bytes_left in the stream. So, we are submitting this patch for review. I've tested this to work with our interface. 

  
> BufferedTransport + C extensions block until recv timeout is reached on last fread call
> ---------------------------------------------------------------------------------------
>
>                 Key: THRIFT-638
>                 URL: https://issues.apache.org/jira/browse/THRIFT-638
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (PHP)
>    Affects Versions: 0.2
>            Reporter: Chris Goffinet
>             Fix For: 0.4
>
>         Attachments: 0001-Replace-freads-with-stream_socket_recvfrom.patch, 0002-tocket-read-meta-data-check.diff
>
>
> I wanted to throw this out if any other folks experience this later on. At Digg we've been using the BufferedTransport + C extension of Thrift in PHP. Every so often, we will see spikes in latency increases on RPC calls that we know have acceptable response times (<200ms). This seems to happen based on how much data is being sent back over the wire. This is more of a PHP problem, but can be corrected in Thrift's PHP library for folks who don't want to upgrade PHP. I am still waiting to see if it's corrected in later versions (we use 5.2.9).
> http://bonsai.php.net/bug.php?id=42720
> Replacing the fread statements in TSocket.php with stream_socket_recvfrom correct this behavior so that calls do not wait until they hit the recv timeout.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.