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

Arya Goudarzi commented on THRIFT-867:
--------------------------------------

I did not try that and here is why:

 I think the transport, socket, and accelerated module have a degree of 
separation in which each handle specific task associated with themselves. For 
example TFramedTransport->flush(), does a write followed by flush and it 
formats its stream according to framed specification of size+buffer not knowing 
what was in its buffer. You are proposing to have a check in the flush() 
function which eliminates writing of empty sized buffers. I am not 100% sure if 
there is no use case in which writing of empty buffer is required, so I did not 
do it. But since the non accelerated module worked perfectly fine, it clearly 
says there is something not right with the other execution path. And there will 
be an extra if check for every flush which does not make sense when flush() 
after flush() is the problem. Thus, I stick with this patch unless it is 
causing some issue or I missed something I did not understand. 

Feel free to take a lead on this if you have a better solution. 

> PHP accelerator module's output transport is incompatible with 
> TFramedTransport
> -------------------------------------------------------------------------------
>
>                 Key: THRIFT-867
>                 URL: https://issues.apache.org/jira/browse/THRIFT-867
>             Project: Thrift
>          Issue Type: Bug
>          Components: PHP - Library
>    Affects Versions: 0.4
>            Reporter: Bryan Duxbury
>             Fix For: 0.5
>
>         Attachments: thrift-867.diff
>
>
> I think we've figured out the cause of everyone's problems with THRIFT-837. 
> The patch itself is fine; however, in fixing that bug, we've exposed the fact 
> that PHPOutputTransport erroneously calls down to the underlying PHP 
> transport's flush() method every time the internal 8k buffer is flushed. This 
> is fine for the buffered transport, but unacceptable for the framed 
> transport, which should only be flushed once per RPC call.
> It seems like what we need to do is separate the "internal" buffer flushes 
> from the "external" transport flushes. If we do that, everything should work 
> out fine.

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

Reply via email to