You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Esteve Fernandez (JIRA)" <ji...@apache.org> on 2009/09/18 10:01:01 UTC

[jira] Created: (THRIFT-585) exceptions in the autogenerated send_METHOD functions are not propagated (Twisted)

exceptions in the autogenerated send_METHOD functions are not propagated (Twisted)
----------------------------------------------------------------------------------

                 Key: THRIFT-585
                 URL: https://issues.apache.org/jira/browse/THRIFT-585
             Project: Thrift
          Issue Type: Bug
          Components: Compiler (Python), Library (Python)
            Reporter: Esteve Fernandez


If an error occurs in the autogenerated send_METHOD functions, the returned deferred is not notified and the caller can't manage the error.

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


Re: [jira] Assigned: (THRIFT-585) exceptions in the autogenerated send_METHOD functions are not propagated (Twisted)

Posted by Mattias de Zalenski <za...@spotify.com>.
>
> > exceptions in the autogenerated send_METHOD functions are not propagated
> (Twisted)
>

A related py:twisted exception handling issue is that unexpected exceptions
passed in via errbacks to the write_results_exception_METHOD functions are
not handled, but cause the connection to be closed.

Here is a patch that sends unexpected exceptions on the wire, like in
standard thrift, as TApplicationException UNKNOWN exceptions. It also adds a
function setUnknownErrorHandler to the Processor, to be able to log errors
or obtain stack traces on the server side, for example.


-- 
Mattias de Zalenski
Software Developer
Spotify

Tel: +46 70 487 74 63
Fax: +46 8 510 62 416

This e-mail (including any attachments) may contain information that is
confidential and/or privileged. It is intended only for the recipient(s).
If you have reason to believe that you are not the intended recipient of
this e-mail, please contact the sender immediately and delete the e-mail
from your computer.

[jira] Commented: (THRIFT-585) exceptions in the autogenerated send_METHOD functions are not propagated (Twisted)

Posted by "Christopher Armstrong (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12878429#action_12878429 ] 

Christopher Armstrong commented on THRIFT-585:
----------------------------------------------

My bad, I didn't even realize that this issue was about a client bug, not a server bug; I missed the actual comment description and only read the first comment.

I'll file another bug for dealing with servers sending errors to clients.

> exceptions in the autogenerated send_METHOD functions are not propagated (Twisted)
> ----------------------------------------------------------------------------------
>
>                 Key: THRIFT-585
>                 URL: https://issues.apache.org/jira/browse/THRIFT-585
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Python), Library (Python)
>            Reporter: Esteve Fernandez
>            Assignee: Esteve Fernandez
>         Attachments: 585-handle-send-exceptions.patch, t_py_generator.cc
>
>
> If an error occurs in the autogenerated send_METHOD functions, the returned deferred is not notified and the caller can't manage the error.

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


[jira] Assigned: (THRIFT-585) exceptions in the autogenerated send_METHOD functions are not propagated (Twisted)

Posted by "Esteve Fernandez (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-585?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Esteve Fernandez reassigned THRIFT-585:
---------------------------------------

    Assignee: Esteve Fernandez

> exceptions in the autogenerated send_METHOD functions are not propagated (Twisted)
> ----------------------------------------------------------------------------------
>
>                 Key: THRIFT-585
>                 URL: https://issues.apache.org/jira/browse/THRIFT-585
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Python), Library (Python)
>            Reporter: Esteve Fernandez
>            Assignee: Esteve Fernandez
>         Attachments: 585-handle-send-exceptions.patch
>
>
> If an error occurs in the autogenerated send_METHOD functions, the returned deferred is not notified and the caller can't manage the error.

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


[jira] Updated: (THRIFT-585) exceptions in the autogenerated send_METHOD functions are not propagated (Twisted)

Posted by "Esteve Fernandez (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-585?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Esteve Fernandez updated THRIFT-585:
------------------------------------

    Attachment: 585-handle-send-exceptions.patch

> exceptions in the autogenerated send_METHOD functions are not propagated (Twisted)
> ----------------------------------------------------------------------------------
>
>                 Key: THRIFT-585
>                 URL: https://issues.apache.org/jira/browse/THRIFT-585
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Python), Library (Python)
>            Reporter: Esteve Fernandez
>         Attachments: 585-handle-send-exceptions.patch
>
>
> If an error occurs in the autogenerated send_METHOD functions, the returned deferred is not notified and the caller can't manage the error.

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


[jira] Commented: (THRIFT-585) exceptions in the autogenerated send_METHOD functions are not propagated (Twisted)

Posted by "Esteve Fernandez (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12757226#action_12757226 ] 

Esteve Fernandez commented on THRIFT-585:
-----------------------------------------

Mattias:

I think the standard blocking Python generator doesn't pass unexpected exceptions from the server to the client (see TSimpleServer#server, it just closes the transports). But it actually does, it's far better to override ThriftServerProtocol#processError rather than adding stuff to the generator.

In any case, if you think the Twisted generator is behaving differently from the blocking version, please file a different issue, if you have a fix for it, attach a patch, not the entire source file. This helps us track issues more effectively.

> exceptions in the autogenerated send_METHOD functions are not propagated (Twisted)
> ----------------------------------------------------------------------------------
>
>                 Key: THRIFT-585
>                 URL: https://issues.apache.org/jira/browse/THRIFT-585
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Python), Library (Python)
>            Reporter: Esteve Fernandez
>            Assignee: Esteve Fernandez
>         Attachments: 585-handle-send-exceptions.patch, t_py_generator.cc
>
>
> If an error occurs in the autogenerated send_METHOD functions, the returned deferred is not notified and the caller can't manage the error.

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


[jira] Updated: (THRIFT-585) exceptions in the autogenerated send_METHOD functions are not propagated (Twisted)

Posted by "Mattias de Zalenski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-585?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mattias de Zalenski updated THRIFT-585:
---------------------------------------

    Attachment: t_py_generator.cc


A related py:twisted exception handling issue is that unexpected exceptions
passed in via errbacks to the write_results_exception_METHOD functions are
not handled, but cause the connection to be closed.

Here is a patch that sends unexpected exceptions on the wire, like in
standard thrift, as TApplicationException UNKNOWN exceptions. It also adds a
function setUnknownErrorHandler to the Processor, to be able to log errors
or obtain stack traces on the server side, for example.


-- 
Mattias de Zalenski
Software Developer
Spotify

Tel: +46 70 487 74 63
Fax: +46 8 510 62 416

This e-mail (including any attachments) may contain information that is
confidential and/or privileged. It is intended only for the recipient(s).
If you have reason to believe that you are not the intended recipient of
this e-mail, please contact the sender immediately and delete the e-mail
from your computer.


> exceptions in the autogenerated send_METHOD functions are not propagated (Twisted)
> ----------------------------------------------------------------------------------
>
>                 Key: THRIFT-585
>                 URL: https://issues.apache.org/jira/browse/THRIFT-585
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Python), Library (Python)
>            Reporter: Esteve Fernandez
>            Assignee: Esteve Fernandez
>         Attachments: 585-handle-send-exceptions.patch, t_py_generator.cc
>
>
> If an error occurs in the autogenerated send_METHOD functions, the returned deferred is not notified and the caller can't manage the error.

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


[jira] Issue Comment Edited: (THRIFT-585) exceptions in the autogenerated send_METHOD functions are not propagated (Twisted)

Posted by "Christopher Armstrong (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12878429#action_12878429 ] 

Christopher Armstrong edited comment on THRIFT-585 at 6/13/10 3:51 PM:
-----------------------------------------------------------------------

My bad, I didn't even realize that this issue was about a client bug, not a server bug; I missed the actual description and only read the first comment.

I'll file another bug for dealing with servers sending errors to clients.

      was (Author: radix):
    My bad, I didn't even realize that this issue was about a client bug, not a server bug; I missed the actual comment description and only read the first comment.

I'll file another bug for dealing with servers sending errors to clients.
  
> exceptions in the autogenerated send_METHOD functions are not propagated (Twisted)
> ----------------------------------------------------------------------------------
>
>                 Key: THRIFT-585
>                 URL: https://issues.apache.org/jira/browse/THRIFT-585
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Python), Library (Python)
>            Reporter: Esteve Fernandez
>            Assignee: Esteve Fernandez
>         Attachments: 585-handle-send-exceptions.patch, t_py_generator.cc
>
>
> If an error occurs in the autogenerated send_METHOD functions, the returned deferred is not notified and the caller can't manage the error.

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


[jira] Commented: (THRIFT-585) exceptions in the autogenerated send_METHOD functions are not propagated (Twisted)

Posted by "Christopher Armstrong (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12878426#action_12878426 ] 

Christopher Armstrong commented on THRIFT-585:
----------------------------------------------

I don't understand why you wouldn't want to send unhandled exceptions back to the client. This issue has been giving me a lot of pain lately, since the client can't know if an error actually occurred  or if it was just some network issue. In other words, I don't see why the blocking python version's precedent is something that should actually be followed in this case.


> exceptions in the autogenerated send_METHOD functions are not propagated (Twisted)
> ----------------------------------------------------------------------------------
>
>                 Key: THRIFT-585
>                 URL: https://issues.apache.org/jira/browse/THRIFT-585
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Python), Library (Python)
>            Reporter: Esteve Fernandez
>            Assignee: Esteve Fernandez
>         Attachments: 585-handle-send-exceptions.patch, t_py_generator.cc
>
>
> If an error occurs in the autogenerated send_METHOD functions, the returned deferred is not notified and the caller can't manage the error.

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