Skip to content
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

feat: retry failed request #1590

Merged
merged 13 commits into from
Dec 26, 2024
Merged

feat: retry failed request #1590

merged 13 commits into from
Dec 26, 2024

Conversation

cr7258
Copy link
Collaborator

@cr7258 cr7258 commented Dec 12, 2024

Ⅰ. Describe what this PR did

允许对失败的请求立即进行重试,以提升用户体验。暂时只支持对非流式请求进行重试。几个重要改动:

  • 新增 TransformResponseHeadersHandlerTransformResponseBodyHandler 接口,provider 实现该接口对响应头和响应体进行修改。
  • 移除 ResponseHeadersHandlerResponseBodyHandler 接口,改为在 main.go 中调用 TransformResponseHeadersHandlerTransformResponseBodyHandler 统一进行处理。
  • 新增 retry.go 处理重试的逻辑。

失败请求重试的日志如下:

image

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-commenter
Copy link

codecov-commenter commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 43.50%. Comparing base (ef31e09) to head (cf44bda).
Report is 242 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1590      +/-   ##
==========================================
+ Coverage   35.91%   43.50%   +7.59%     
==========================================
  Files          69       76       +7     
  Lines       11576    12325     +749     
==========================================
+ Hits         4157     5362    +1205     
+ Misses       7104     6627     -477     
- Partials      315      336      +21     

see 69 files with indirect coverage changes

@cr7258 cr7258 requested a review from rinfx as a code owner December 19, 2024 13:32
@cr7258 cr7258 requested a review from CH3CHO December 19, 2024 14:02
Copy link
Collaborator

@CH3CHO CH3CHO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@CH3CHO CH3CHO merged commit 579c986 into alibaba:main Dec 26, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants