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

Yuxuan Wang commented on THRIFT-5875:
-------------------------------------

SIZE_LIMIT and INVALID_DATA are both codes for TProtocolException, not 
TTransportException.

Also I think it's better to use something already in the spec and supported by 
other languages, than adding something new that's only understood by a single 
language, so I'd prefer to use INVALID_DATA (which is already supported by most 
if not all languages) than adding a new CORRUPTED_DATA.

Of course, if there's a good reason that we need to distinguish between them, 
then we can add CORRUPTED_DATA, but it should be added to more languages (or 
the spec).

> ServerContext offers API to catch the thrift exception
> ------------------------------------------------------
>
>                 Key: THRIFT-5875
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5875
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Java - Library
>            Reporter: Zhihua Deng
>            Assignee: Zhihua Deng
>            Priority: Major
>
> If we the exception thrown from transport lawyer, such as the
> MESSAGE_SIZE_LIMIT or CORRUPTED_DATA, in order not to pollute the byte 
> stream, the server will kill the transport, on the client side it would 
> receive the message indicating the socket is killed by peer. It's would be 
> nice if we can send the exception back to the client to tell what's happening 
> on the server side, the TServerEventHandler deleteContext provides a way for 
> such purpose if we can get the exception from the ServerContext. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to