[ https://issues.apache.org/jira/browse/THRIFT-5573?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Liu Jiayu updated THRIFT-5573: ------------------------------ Description: Currently when an exception is thrown, serialized and de-serialized into async client (AsyncIface which in turn uses TAsyncClient), the ___error field is set: [onError|https://github.com/apache/thrift/blob/88a45ac77518eafb57db08938ecdf38c5fcf7a31/lib/java/src/main/java/org/apache/thrift/async/TAsyncClient.java#L99-L103] However after that there's no way to reset that ___error field even if the exception is handled by callback, resulting in that the client is no longer usable, because in: [onReady|https://github.com/apache/thrift/blob/88a45ac77518eafb57db08938ecdf38c5fcf7a31/lib/java/src/main/java/org/apache/thrift/async/TAsyncClient.java#L75-L85] method the ___error field is checked and refused to continue. We should probably either: * find a way to let clients or callers to reset the field, or * document it clearly that call site should re-create the client from async client factory upon encountering an exception was: Currently when an exception is thrown, serialized and de-serialized into async client (AsyncIface which in turn uses TAsyncClient), the ___error field is set: [onError|https://github.com/apache/thrift/blob/88a45ac77518eafb57db08938ecdf38c5fcf7a31/lib/java/src/main/java/org/apache/thrift/async/TAsyncClient.java#L99-L103] However after that there's no way to reset that ___error field even if the exception is handled by callback, resulting in that the client is no longer usable, because in: [onReady|https://github.com/apache/thrift/blob/88a45ac77518eafb57db08938ecdf38c5fcf7a31/lib/java/src/main/java/org/apache/thrift/async/TAsyncClient.java#L75-L85] method the ___error field is checked and refused to continue. We should probably find a way to let clients or callers to reset the field. > In Java lib, TAsyncClient does not reset ___error after exception was raised > ---------------------------------------------------------------------------- > > Key: THRIFT-5573 > URL: https://issues.apache.org/jira/browse/THRIFT-5573 > Project: Thrift > Issue Type: Bug > Components: Java - Library > Reporter: Liu Jiayu > Priority: Minor > > Currently when an exception is thrown, serialized and de-serialized into > async client (AsyncIface which in turn uses TAsyncClient), the ___error field > is set: > [onError|https://github.com/apache/thrift/blob/88a45ac77518eafb57db08938ecdf38c5fcf7a31/lib/java/src/main/java/org/apache/thrift/async/TAsyncClient.java#L99-L103] > However after that there's no way to reset that ___error field even if the > exception is handled by callback, resulting in that the client is no longer > usable, because in: > [onReady|https://github.com/apache/thrift/blob/88a45ac77518eafb57db08938ecdf38c5fcf7a31/lib/java/src/main/java/org/apache/thrift/async/TAsyncClient.java#L75-L85] > method the ___error field is checked and refused to continue. > We should probably either: > * find a way to let clients or callers to reset the field, or > * document it clearly that call site should re-create the client from async > client factory upon encountering an exception -- This message was sent by Atlassian Jira (v8.20.7#820007)