You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Eric Jensen (JIRA)" <ji...@apache.org> on 2010/10/06 01:44:32 UTC

[jira] Commented: (THRIFT-945) TAsyncClient class's currentMethod is never set, hence a second call on the same client will fail if a previous call is ongoing.

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

Eric Jensen commented on THRIFT-945:
------------------------------------

it's a common misunderstanding that this client could possibly support concurrent calls.  it cannot since it is backed only by a single socket just like the blocking Client calls.  if you want concurrent calls you must pool these clients or their sockets yourself.

> TAsyncClient class's currentMethod is never set, hence a second call on the same client will fail if a previous call is ongoing.
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-945
>                 URL: https://issues.apache.org/jira/browse/THRIFT-945
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Library
>    Affects Versions: 0.4
>            Reporter: Zhenlei Cai
>
> TAsyncClient has this check:
>   protected void checkReady() {
>     // Ensure we are not currently executing a method
>     if (currentMethod != null) {
>       throw new IllegalStateException("Client is currently executing another method: " + currentMethod.getClass().getName());
>     }
> However currentMethod is not being set anywhere. 
> In my code I have a TAsyncClient  and  method calls made on it are not necessarily serialized (one starts after previous finishes), so interleaving calls will fail with mysterious messages such as:
> java.lang.IllegalArgumentException
> 	at java.nio.ByteBuffer.allocate(ByteBuffer.java:311)
> 	at org.apache.thrift.async.TAsyncMethodCall.doReadingResponseSize(TAsyncMethodCall.java:175)
> 	at org.apache.thrift.async.TAsyncMethodCall.transition(TAsyncMethodCall.java:128)
> 	at org.apache.thrift.async.TAsyncClientManager$SelectThread.run(TAsyncClientManager.java:99)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.