Skip to content

How to add timeouts for each retry attempt? Will current code support that? #2448

Answered by peter-csala
pulkitent asked this question in Q&A
Discussion options

You must be logged in to vote

Now at 2:05:00 AM (ideally) this operation will timeout? Is my understanding correct?

No. Since you have called the AddTimeout after the AddRetry that's why the timeout strategy is applied per retry attempt. So, in this particular case each retry attempt has a five minutes window to complete.

In worst case scenario this means the following:

  1. 0th attempt (original request) starts at 2:00 and ends at 2:05 because it times out
  2. The retry strategy sleeps 0 minute
  3. 1st attempt (first retry attempt) starts at 2:05 and ends at 2:10 because it times out
  4. The retry strategy sleeps 1 minute
  5. 2nd attempt (second retry attempt) starts at 2:11 and ends at 2:16 because it times out
  6. The retry strategy sle…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@peter-csala
Comment options

@martincostello
Comment options

@pulkitent
Comment options

@peter-csala
Comment options

Answer selected by pulkitent
@pulkitent
Comment options

@peter-csala
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants