Skip to content

fix: panic not triggered when all retries return ErrRPCFinish #1814

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

yangma0
Copy link

@yangma0 yangma0 commented Jul 10, 2025

[What type of PR is this?](fix: panic not triggered when all retries return ErrRPCFinish)

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.
修复 MixedRetryer.Do 中所有重试请求返回 ErrRPCFinished 时未能触发 panic 的问题

(Optional) More detailed description for this PR(en: English/zh: Chinese).
en:
This PR adds a test case to reproduce a rare panic scenario where all retry attempts in MixedRetryer.Do return ErrRPCFinished, leading to unexpected behavior (no panic triggered and nil response returned).
A fix is also provided to ensure proper panic is raised when all responses are ErrRPCFinished, maintaining consistency with the retry strategy design.
zh(optional):
本 PR 添加了一个测试用例,用于复现 MixedRetryer.Do 方法中所有重试请求都返回 ErrRPCFinished 时未能触发预期 panic 的问题。同时也修复了该逻辑,确保在这种极端场景下能够正确 panic,防止返回预期之外的err导致程序运行异常。
(Optional) Which issue(s) this PR fixes:

(optional) The PR that updates user documentation:

@yangma0 yangma0 requested review from a team as code owners July 10, 2025 03:36
@CLAassistant
Copy link

CLAassistant commented Jul 10, 2025

CLA assistant check
All committers have signed the CLA.

@yangma0 yangma0 changed the title test(retry): add testcase to reproduce panic when all retries return … fix: panic not triggered when all retries return ErrRPCFinish Jul 10, 2025
@ppzqh
Copy link
Contributor

ppzqh commented Jul 16, 2025

thanks for the feedback, we will review the code

Copy link

codecov bot commented Jul 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.44%. Comparing base (b3a437e) to head (3080f32).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1814   +/-   ##
=======================================
  Coverage   60.44%   60.44%           
=======================================
  Files         380      380           
  Lines       34485    34486    +1     
=======================================
+ Hits        20843    20846    +3     
+ Misses      12376    12372    -4     
- Partials     1266     1268    +2     
Flag Coverage Δ
integration 48.26% <11.11%> (-0.05%) ⬇️
unit 50.91% <100.00%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants