Github user jsirois commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/840#discussion_r53405396
  
    --- Diff: lib/java/src/org/apache/thrift/async/TAsyncMethodCall.java ---
    @@ -225,8 +231,13 @@ private void cleanUpAndFireCallback(SelectionKey key) {
         key.interestOps(0);
         // this ensures that the TAsyncMethod instance doesn't hang around
         key.attach(null);
    --- End diff --
    
    Adding cancel won't (doesn't) work.  The key is associated with the single 
underlying channel (wrapped in a `TNonblockingTransport`) from the 
`TAsyncClient` which is intended for use with multiple concurrent calls afaict. 
 The `org.apache.thrift.async.TestTAsyncClientManager#testParallelCalls` test 
uses the client in this way - 1 client, multiple concurrent calls - and 
demonstrates that cancelling the key cancels the underlying channel and, for 
example, you get 1 successful call and 4999 failed calls in the 5000 call test 
case as a result.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to