-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retry backoff docs? #2168
Comments
The def retry_for(retry_count)
(retry_count ** 4) + 15 + (rand(30) * (retry_count + 1))
end
(1..25).each do |n|
cumulative_days = (1..n).map { |x| retry_for(x) }.inject(:+).to_f / (60 * 60 * 24)
puts "#{cumulative_days} days for retry attempt #{n}"
end
# 0.000787037037037037 days for retry attempt 1
# 0.0013078703703703703 days for retry attempt 2
# 0.003993055555555555 days for retry attempt 3
# 0.006400462962962963 days for retry attempt 4
# 0.015925925925925927 days for retry attempt 5
# 0.0340162037037037 days for retry attempt 6
# 0.06439814814814815 days for retry attempt 7
# 0.11091435185185185 days for retry attempt 8
# 0.18971064814814814 days for retry attempt 9
# 0.30571759259259257 days for retry attempt 10
# 0.47291666666666665 days for retry attempt 11
# 0.7178472222222222 days for retry attempt 12
# 1.0547916666666666 days for retry attempt 13
# 1.4991087962962963 days for retry attempt 14
# 2.0853819444444444 days for retry attempt 15
# 2.8479282407407407 days for retry attempt 16
# 3.8154050925925924 days for retry attempt 17
# 5.029976851851852 days for retry attempt 18
# 6.559722222222222 days for retry attempt 19
# 8.407662037037037 days for retry attempt 20
# 10.647604166666667 days for retry attempt 21
# 13.372638888888888 days for retry attempt 22
# 16.627037037037038 days for retry attempt 23
# 20.459085648148147 days for retry attempt 24
# 24.980717592592594 days for retry attempt 25 |
Yes, you need to add the retry times together! Looks like it's closer to 25 days:
With 0..24, it's 20.5 days so someone probably has an off-by-one. |
@mperham snap :) |
Ah, makes sense! Thanks guys |
Closed
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
According to the wiki here: https://github.com/mperham/sidekiq/wiki/Error-Handling
The default retry backoff algorithm is:
The wiki claims that the default 25 count retry using this algorithm spans ~21 days however I only get ~4 days when I put that to the test:
Am I miss-understanding something?
The text was updated successfully, but these errors were encountered: