thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (THRIFT-1805) Thrift should not swallow ALL exceptions
Date Mon, 13 Feb 2017 19:27:41 GMT

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

ASF GitHub Bot commented on THRIFT-1805:
----------------------------------------

Github user keith-turner commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/1186#discussion_r100875982
  
    --- Diff: compiler/cpp/src/thrift/generate/t_java_generator.cc ---
    @@ -5265,6 +5274,9 @@ THRIFT_REGISTER_GENERATOR(
         "    android_legacy:  Do not use java.io.IOException(throwable) (available for Android
2.3 and "
         "above).\n"
         "    option_type:     Wrap optional fields in an Option type.\n"
    +    "    handle_runtime_exceptions:\n"
    +    "                     Generated services will handle RuntimeException as "
    --- End diff --
    
    I like that.  I was also trying to document what the default behavior is.  When someone
is trying to make decision about enabling the option, its nice to know what not enabling it
means.


> Thrift should not swallow ALL exceptions
> ----------------------------------------
>
>                 Key: THRIFT-1805
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1805
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Compiler, Java - Library
>    Affects Versions: 0.9
>            Reporter: Diwaker Gupta
>            Assignee: Diwaker Gupta
>         Attachments: THRIFT-1805.patch
>
>
> In Thrift 0.8.0, Thrift generated Java code did not swallow application exceptions. As
a result of THRIFT-1658, this behavior changed in 0.9.0 and now the generated code swallows
ALL application exceptions (via ProcessFunction). Apparently this was the behavior in Thrift
0.6.0 and while I see the rationale, it is breaking our applications.
> Our code relies on the fact that exceptions can propagate outside of Thrift for certain
things (e.g., to aggressively drop connections for clients that send invalid/malformed requests).
ProcessFunction makes it near impossible to do this -- not only does it swallow the exception,
it also loses all information about the original exception and just writes out a generic TApplicationException.
> IMO ProcessFunction should only catch TException. If the application code wants to use
other exceptions for some reason (in particular, Errors and RuntimeExceptions), Thrift shouldn't
prevent that.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message