thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Tubbs (JIRA)" <>
Subject [jira] [Commented] (THRIFT-1805) Thrift should not swallow ALL exceptions
Date Thu, 23 Feb 2017 01:39:44 GMT


Christopher Tubbs commented on THRIFT-1805:

In Accumulo, I added a test, "" which uses a bi-directional in-memory
transport to test exception handling behavior in Thrift, using our internal "RpcWrapper" to
wrap the service processor and catch RuntimeExceptions.
(contained in this commit:

I'd like the test (or something like it) to be adapted to prevent regressions in Thrift directly.
I might even be willing to work on it. However, the current behavior is undefined when the
server encounters a RuntimeException, and undefined behavior is untestable. I'm not sure a
regression test even makes sense unless the most recent regression is also reverted back to
a well-defined behavior.

> Thrift should not swallow ALL exceptions
> ----------------------------------------
>                 Key: THRIFT-1805
>                 URL:
>             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

View raw message