Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-2108

Fix TAsyncClientManager timeout race

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.9
    • Fix Version/s: 0.9.2
    • Component/s: Java - Library
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      TAsyncClientManager uses a TreeSet(timeoutWatchSet) for managing timeouts with a comparator based on the timeout timestamp. However, this timestamp can be mutated externally by changing the client timeout before TAsyncClientManager tries to remove (and fails) the TAsyncMethodCall from the timeout set.

      Failing to delete the TAsyncMethodCall from the timeoutWatchSet will break some timeouts and cause some callbacks to fire twice, once with onComplete and a second time with onError.

      The common use case when this happens is if you want to issue a new request with a different timeout to the same client inside an onComplete callback.

        Attachments

          Activity

            People

            • Assignee:
              roger Roger Meier
              Reporter:
              vadims Vadim Spivak
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: