Thrift
  1. Thrift
  2. 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.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.4
    • Fix Version/s: None
    • Component/s: Java - Library
    • Labels:
      None

      Description

      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)

      1. thrift-945.patch
        3 kB
        Bryan Duxbury

        Activity

          People

          • Assignee:
            Bryan Duxbury
            Reporter:
            Zhenlei Cai
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development