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

fix: connection pool leak #625

Merged
merged 2 commits into from
Feb 24, 2023
Merged

Conversation

wzekin
Copy link
Contributor

@wzekin wzekin commented Feb 20, 2023

What type of PR is this?

fix

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.

(Optional) Translate the PR title into Chinese.

修复链接池泄漏

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

en: When the client uses bodystream to receive data, if the user uses netpoll and does not close the bodyStream properly, it can cause a link pool leak. Use runtime.SetFinalizer as a bailout to close the bodyStream.
zh(optional): 在 client 使用 bodystream 接收数据的时候,如果用户使用 netpoll 且没有正确关闭 bodyStream,则会造成链接池泄漏。使用 runtime.SetFinalizer 作为保底措施来关闭bodyStream。

Which issue(s) this PR fixes:

@wzekin wzekin requested review from a team as code owners February 20, 2023 12:34
@wzekin wzekin force-pushed the fix/conn_pool_leak branch from 351c86a to 8f472d2 Compare February 21, 2023 02:27
@codecov
Copy link

codecov bot commented Feb 21, 2023

Codecov Report

Base: 72.09% // Head: 72.52% // Increases project coverage by +0.43% 🎉

Coverage data is based on head (0fca517) compared to base (a3f6f9b).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head 0fca517 differs from pull request most recent head b0bf471. Consider uploading reports for the commit b0bf471 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #625      +/-   ##
===========================================
+ Coverage    72.09%   72.52%   +0.43%     
===========================================
  Files           96       96              
  Lines         9390     9392       +2     
===========================================
+ Hits          6770     6812      +42     
+ Misses        2188     2151      -37     
+ Partials       432      429       -3     
Impacted Files Coverage Δ
pkg/protocol/http1/resp/response.go 71.11% <100.00%> (+0.43%) ⬆️
pkg/protocol/http1/client.go 56.34% <0.00%> (+7.69%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

welkeyever
welkeyever previously approved these changes Feb 21, 2023
FGYFFFF
FGYFFFF previously approved these changes Feb 22, 2023
@wzekin wzekin force-pushed the fix/conn_pool_leak branch from 2d8cc9b to b27e09a Compare February 23, 2023 08:39
@Duslia Duslia dismissed stale reviews from FGYFFFF and welkeyever via b27e09a February 24, 2023 03:30
@FGYFFFF FGYFFFF merged commit 8044543 into cloudwego:develop Feb 24, 2023
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