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

Christopher Tubbs commented on THRIFT-1805:
-------------------------------------------

The original design (since version 0.2, THRIFT-378) did seem to provide a 
useful exception back to the clients (TApplicationException), which was clearly 
distinguishable from intended exceptions sent from the server created by the 
user, and also easily distinguishable from client-side exceptions due to, say, 
temporary network errors. I really liked how that original behavior worked, but 
it has flip-flopped with THRIFT-447 in 0.7, THRIFT-1658 in 0.9, THRIFT-1805 in 
0.9.1.

I'm not sure the framework should catch server-side Errors (those can't really 
be handled reliably, but an argument could be made for a best-effort attempt to 
let the client know anyway)... but server-side RuntimeExceptions, yeah, that'd 
be very helpful helpful for the framework to turn into TApplicationExceptions 
like it was intended to do since 0.2/THRIFT-378.

> 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.4#6332)

Reply via email to