-
Notifications
You must be signed in to change notification settings - Fork 878
fix(retry): mix_retry waits for backoff even the first call is successful #1879
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1879 +/- ##
==========================================
- Coverage 61.37% 59.09% -2.29%
==========================================
Files 388 388
Lines 35063 34458 -605
==========================================
- Hits 21521 20364 -1157
- Misses 12247 12808 +561
+ Partials 1295 1286 -9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4efbb3d to
609ac2e
Compare
Pull Request Review - #1879SummaryThis PR fixes a bug in the mixed retry logic where backoff delays were being executed even when the first call succeeded. The fix reorders condition checks to first verify if a result should trigger a retry before checking if a retry is allowed. Code Quality & Best Practices ✅Positive aspects:
Suggestions:
Bug Analysis 🐛Original Issue: Root Cause: // OLD (buggy) - lines 161-170
if msg, ok := r.ShouldRetry(ctx, nil, callCount, req, cbKey); ok {
if r.isRetryResult(ctx, res.ri, res.resp, res.err, &r.policy.FailurePolicy) {
// retry logic
}
}This caused the system to:
The Fix: // NEW (fixed) - lines 161-170
if r.isRetryResult(ctx, res.ri, res.resp, res.err, &r.policy.FailurePolicy) {
if msg, ok := r.ShouldRetry(ctx, nil, callCount, req, cbKey); ok {
// retry logic
}
}Now the system:
Impact: This prevents unnecessary latency when calls succeed on the first attempt. Performance Considerations ⚡Positive Impact:
Test Evidence:
Security Concerns 🔒No security issues identified:
Test Coverage ✅Excellent test coverage: The PR adds comprehensive test coverage via
Test Quality:
Minor note:
RecommendationsThis PR is ready to merge with the following minor suggestions:
ConclusionVerdict: LGTM ✅ (Looks Good To Me) This is a high-quality bug fix that:
The fix is minimal, well-tested, and improves user experience by eliminating unnecessary latency on successful calls. Approval recommended. Review performed by Claude Code |
609ac2e to
bf6425b
Compare
What type of PR is this?
fix
Check the PR title.
(Optional) Translate the PR title into Chinese.
fix(retry): 混合重试在第一次调用成功后依然会执行 backoff 逻辑
(Optional) More detailed description for this PR(en: English/zh: Chinese).
en:
zh(optional):
bug 引入版本:Kitex v0.11.0,支持混合重试时该 bug 便存在。
(Optional) Which issue(s) this PR fixes:
(optional) The PR that updates user documentation: