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

Anthony Molinaro commented on THRIFT-785:
-----------------------------------------

I came across the same issue yesterday in a slightly different guise.  I'm 
using the refactored code from THRIFT-599.

 The good news is the python client returns correctly and the server does not 
die.  The bad news it still spews an error

=CRASH REPORT==== 21-Aug-2010::04:20:36 ===
  crasher:
    initial call: thrift_socket_server:acceptor_loop/1
    pid: <0.45.0>
    registered_name: []
    exception error: no match of right hand side value 
                     {{transport,thrift_socket_transport,
                                 {data,#Port<0.647>,3600000}},
                      {error,closed}}
      in function  thrift_framed_transport:read/2
      in call from thrift_transport:read/2
      in call from thrift_binary_protocol:read_data/2
      in call from thrift_binary_protocol:read/2
      in call from thrift_binary_protocol:read/2
      in call from thrift_protocol:read_specific/2
      in call from thrift_processor:loop/1
    ancestors: [test_server,<0.42.0>]
    messages: []
    links: [<0.44.0>,#Port<0.647>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 610
    stack_size: 24
    reductions: 604
  neighbours:

=ERROR REPORT==== 21-Aug-2010::04:20:36 ===
{thrift_socket_server,244,
    {child_error,
        {badmatch,
            {{transport,thrift_socket_transport,{data,#Port<0.647>,3600000}},
             {error,closed}}},
        []}}

Looking through the framed_transport it looks like it will currently crash in 
this way every time the client closes a connection.  The problem is in the 
read/2 call lines 73-80.  The current call has been finished and a read happens 
for the next call.  Unfortunately the client has disconnected so the 
thrift_transport:read call on line 76 returns {error, closed}.  It looks like 
either of those read calls could result in a connection close.  So I'll try to 
put together a patch which passes the error outward since that's what really 
should happen.

> Framed transport server problems
> --------------------------------
>
>                 Key: THRIFT-785
>                 URL: https://issues.apache.org/jira/browse/THRIFT-785
>             Project: Thrift
>          Issue Type: Bug
>          Components: Erlang - Library
>    Affects Versions: 0.4
>            Reporter: Manish Singh
>         Attachments: erlframedtest.erl, erlframedtest.thrift
>
>
> If I try to call the erlang thirift service associated with the attached 
> files in framed mode from python, it dies with:
> $ gen-py/erlframedtest/FramedTest-remote -h localhost:9999 -f hi
> =ERROR REPORT==== 19-May-2010::15:09:20 ===
> ** Generic server <0.41.0> terminating 
> ** Last message in was {read,4}
> ** When Server state == {framed_transport,
>                             {transport,thrift_socket_transport,
>                                 {data,#Port<0.847>,500}},
>                             <<>>,[]}
> ** Reason for termination == 
> ** {{badmatch,{error,closed}},
>     [{thrift_framed_transport,handle_call,3},
>      {gen_server,handle_msg,5},
>      {proc_lib,init_p_do_apply,3}]}
> =ERROR REPORT==== 19-May-2010::15:09:20 ===
> {thrift_socket_server,245,
>                       {child_error,{{badmatch,{error,closed}},
>                                     [{thrift_framed_transport,handle_call,3},
>                                      {gen_server,handle_msg,5},
>                                      {proc_lib,init_p_do_apply,3}]},
>                                    []}}
> This is with erlang R13B04.

-- 
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