Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Tried two implementations (will update the benchmark result later for proper choice):

  1. based on timer trigger (Poc1: https://github.com/lincoln-lil/flink/pull/new/async-retry-timer)
  2. based on DelayQueue with a pull fashion (Poc2: https://github.com/lincoln-lil/flink/pull/new/async-op-retry)


we prefer the timer-based solution, which obtains precise delay control through simple logic and only needs to pay (what we consider to be acceptable) timer instance cost for the retry element. 

Comparation of the two implementations:

Solution

Pros

Cons

based on timer

1. simple
2. precise delay time

1. rely on timer service and more timer instances

based on DelayQueue

1. no timer instance

1. rely on java DelayQueue and Slightly more complex
2. Loss of delay time accuracy
3. The cost of polling the DelayQueue

1. based on timer trigger

...