CAICAIIs opened a new pull request, #3180:
URL: https://github.com/apache/dubbo-go/pull/3180
### Summary
Replace the fixed 5-second retry interval in Failback cluster with
exponential backoff (1s→60s) to prevent retry storms when downstream services
experience extended outages.
### Problem
The current Failback cluster implementation uses a **fixed 5-second
interval** for all retry attempts:
```go
if time.Since(retryTask.lastT).Seconds() < 5 {
break
}
```
This causes retry storm issues in production:
- When a downstream service is down, all failed requests are retried every 5
seconds
- With 100 concurrent failures, the downstream receives 100 retry requests
every 5 seconds
- This creates unnecessary pressure on recovering services and delays
recovery
### Solution
Implement exponential backoff using github.com/cenkalti/backoff/v4:
| Parameter | Value |
|-----------|-------|
| Initial Interval | 1 second |
| Max Interval | 60 seconds |
| Multiplier | 1.5 (default) |
| Max Elapsed Time | 0 (never timeout) |
Retry interval progression: 1s → 1.5s → 2.25s → 3.4s → 5s → 7.5s → ... → 60s
(cap)
### Changes
- Add nextBackoff and backoff fields to retryTimerTask struct
- Replace fixed 5 seconds check with dynamic nextBackoff duration
- Calculate next backoff interval after each retry attempt
- Add info-level logging for retry scheduling
- Update unit tests to reflect new backoff behavior
### Description
Fixes #3179
### Checklist
- [x] I confirm the target branch is `develop`
- [x] Code has passed local testing
- [x] I have added tests that prove my fix is effective or that my feature
works
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]