You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Manish Singh (JIRA)" <ji...@apache.org> on 2010/05/20 00:19:55 UTC
[jira] Created: (THRIFT-785) Framed transport server problems
Framed transport server problems
--------------------------------
Key: THRIFT-785
URL: https://issues.apache.org/jira/browse/THRIFT-785
Project: Thrift
Issue Type: Bug
Components: Library (Erlang)
Affects Versions: 0.4
Reporter: Manish Singh
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.
[jira] Resolved: (THRIFT-785) Framed transport server problems
Posted by "David Reiss (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Reiss resolved THRIFT-785.
--------------------------------
Fix Version/s: 0.5
Resolution: Fixed
I renamed your "_Reason" variables to Reason1 and Reason2, because I don't think it's good to name variables with leading underscores if their values are used.
> 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
> Assignee: Anthony Molinaro
> Fix For: 0.5
>
> Attachments: erlframedtest.erl, erlframedtest.thrift, thrift-erl-framed.patch
>
>
> 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.
[jira] Assigned: (THRIFT-785) Framed transport server problems
Posted by "Anthony Molinaro (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Anthony Molinaro reassigned THRIFT-785:
---------------------------------------
Assignee: Anthony Molinaro
> 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
> Assignee: Anthony Molinaro
> 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.
[jira] Updated: (THRIFT-785) Framed transport server problems
Posted by "Manish Singh (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Manish Singh updated THRIFT-785:
--------------------------------
Attachment: erlframedtest.thrift
erlframedtest.erl
Test files
> Framed transport server problems
> --------------------------------
>
> Key: THRIFT-785
> URL: https://issues.apache.org/jira/browse/THRIFT-785
> Project: Thrift
> Issue Type: Bug
> Components: Library (Erlang)
> 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.
[jira] Updated: (THRIFT-785) Framed transport server problems
Posted by "Anthony Molinaro (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Anthony Molinaro updated THRIFT-785:
------------------------------------
Attachment: thrift-erl-framed.patch
This patch make sure that the thrift_framed_transport:read/2 function passes lower level read errors outward. It solves the problem for me. I'll be putting it into production soon.
> 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
> Assignee: Anthony Molinaro
> Attachments: erlframedtest.erl, erlframedtest.thrift, thrift-erl-framed.patch
>
>
> 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.
[jira] Updated: (THRIFT-785) Framed transport server problems
Posted by "Anthony Molinaro (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Anthony Molinaro updated THRIFT-785:
------------------------------------
Patch Info: [Patch Available]
> 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
> Assignee: Anthony Molinaro
> Attachments: erlframedtest.erl, erlframedtest.thrift, thrift-erl-framed.patch
>
>
> 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.
[jira] Commented: (THRIFT-785) Framed transport server problems
Posted by "Anthony Molinaro (JIRA)" <ji...@apache.org>.
[ 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.
[jira] Commented: (THRIFT-785) Framed transport server problems
Posted by "Anthony Molinaro (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12904536#action_12904536 ]
Anthony Molinaro commented on THRIFT-785:
-----------------------------------------
Yeah, I'm sure I meant to remove the underscores, and just didn't quite catch it in the final patch, thanks for getting rid of those.
> 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
> Assignee: Anthony Molinaro
> Fix For: 0.5
>
> Attachments: erlframedtest.erl, erlframedtest.thrift, thrift-erl-framed.patch
>
>
> 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.