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

optimize(http1): retry if the error is caused by broken pooled conn #871

Merged
merged 7 commits into from
Jul 31, 2023

Conversation

welkeyever
Copy link
Member

@welkeyever welkeyever commented Jul 24, 2023

What type of PR is this?

optimize

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.

HTTP/1.1 client 增加对于连接池中连接被提前关闭导致的错误请求的重试

(Optional) More detail description for this PR(en: English/zh: Chinese).

en:
Since hertz does not retry by default, once the connection in the connection pool is closed by the peer in advance, the client's request will directly fail this time, which is unreasonable.
This optimization adds a default retry logic for such scenarios to ensure that no more requests will fail due to problems with the connection pool itself.

zh(optional):
由于hertz默认是不重试的,一旦连接池中的连接被对方提前关闭,那么客户端这次的请求将直接失败,这是不合理的。
此次优化针对此类场景添加了默认的重试逻辑,保证不会再有请求因为连接池本身的问题而失败。

(Optional) Which issue(s) this PR fixes:

(Optional) The PR that updates user documentation:

@welkeyever welkeyever requested review from a team as code owners July 24, 2023 09:32
@welkeyever welkeyever force-pushed the optimize/client_conn_pool branch 3 times, most recently from 3c4ad1e to fe96af9 Compare July 24, 2023 09:55
@welkeyever welkeyever force-pushed the optimize/client_conn_pool branch from 9375cca to 1d5f5ca Compare July 25, 2023 12:11
@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Patch coverage: 89.65% and project coverage change: +0.22% 🎉

Comparison is base (3161f04) 79.74% compared to head (e7c706e) 79.96%.
Report is 1 commits behind head on develop.

❗ Current head e7c706e differs from pull request most recent head 67049c0. Consider uploading reports for the commit 67049c0 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #871      +/-   ##
===========================================
+ Coverage    79.74%   79.96%   +0.22%     
===========================================
  Files           97       97              
  Lines         9534     9580      +46     
===========================================
+ Hits          7603     7661      +58     
+ Misses        1432     1420      -12     
  Partials       499      499              
Files Changed Coverage Δ
pkg/common/errors/errors.go 87.95% <ø> (ø)
pkg/protocol/http1/server.go 74.27% <ø> (ø)
pkg/protocol/http1/client.go 73.63% <81.25%> (+0.51%) ⬆️
pkg/common/test/mock/network.go 93.12% <100.00%> (+7.09%) ⬆️

... and 2 files with indirect coverage changes

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

@welkeyever welkeyever force-pushed the optimize/client_conn_pool branch from 0353b2a to 746e1ca Compare July 26, 2023 11:45
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.

4 participants