sdk-java icon indicating copy to clipboard operation
sdk-java copied to clipboard

Don't use BackoffThrottler in multithread contexts

Open mjameswh opened this issue 3 years ago • 0 comments

What was changed

  • Avoid using BackoffThrottler instances in multi-thread contexts (Poller)
  • Merged AsyncBackoffThrotter into BackoffThrotter; BackoffThrottler now has a throttleAsync() method

Why?

  • BackoffThrottler was not designed to provide an external thread safe semantic; consequently, a race condition between several threads could result in skipping throttling or in throttling more than expected.
  • These changes will make it much easier to implement longer backoff time on RESOURCE_EXHAUSTION failures.

mjameswh avatar Sep 30 '22 20:09 mjameswh