Use fibonacci backoff to allow full wait time for new environment 403s#8
Conversation
henryrecker-pingidentity
commented
Mar 27, 2026
- Use a backoff function to allow full 30+ second wait time for 403 errors when working with brand-new environments. Previously that max retry limit of 10 would prevent a full wait for 403 errors to resolve
- Use fibonacci backoff and a smaller max backoff duration of 10 seconds when retrying 403 errors
patrickcping
left a comment
There was a problem hiding this comment.
I'm in agreement that the resources that need it get a smarter backoff strategy. Just need to check whether having two backoff implementations to do roughly the same thing is the right way to go
| } No newline at end of file | ||
| } | ||
|
|
||
| func calculateFibonacciBackoff(attempt int, baseDelay time.Duration, maxDuration time.Duration) (time.Duration, error) { |
There was a problem hiding this comment.
Is there a material difference between the two backoff strategies? Should we just flatten to a single algorithm?
There was a problem hiding this comment.
I felt that exponential was excessive given our previous 403 retries were just running every second, and fibonacci is a good middle ground that still actually backs off (to a lesser extent).
I actually do think that fibonacci makes more sense than exponential for our purposes, and I think a 30 second max backoff is probably excessive in most cases. I just was trying to not modify existing functionality in this PR. If you're happy with removing exponential then I can include that in this PR.
There was a problem hiding this comment.
Ok I took a look at the P1 docs and they do explicitly recommend exponential backoff for retries, so maybe it's best that we stick with them https://developer.pingidentity.com/pingone-api/platform/working-with-pingone-apis/retry-best-practices.html
Do you remember if there was a reason you went with retries every second originally for these 403 errors vs. the exponential backoffs we use for other retries?
There was a problem hiding this comment.
I think, at the time, it was just to keep the implementation simple while we were waiting for more guidance