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:polaris config watch #3082

Merged
merged 4 commits into from
Dec 4, 2023

Conversation

tan-zhuo
Copy link
Contributor

@tan-zhuo tan-zhuo commented Nov 13, 2023

Description (what this PR does / why we need it):

The high CPU usage issue caused by watching the Polaris config, particularly in situations when config events are closed.

If the configuration connection has already been closed, the configuration file monitoring should be canceled.

Otherwise, the following method call will enter into an infinite loop. It is necessary to throw a connection-closed exception to cancel the monitoring.

filePath:config/config.go

image

filePath: contrib/polaris/config.go

image

…articularly in situations when config events are closed.
@codecov-commenter
Copy link

codecov-commenter commented Nov 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d13071e) 84.28% compared to head (1489949) 84.28%.

❗ Current head 1489949 differs from pull request most recent head 3f79526. Consider uploading reports for the commit 3f79526 to get more accurate results

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3082   +/-   ##
=======================================
  Coverage   84.28%   84.28%           
=======================================
  Files          88       88           
  Lines        3984     3984           
=======================================
  Hits         3358     3358           
  Misses        449      449           
  Partials      177      177           

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

shenqidebaozi
shenqidebaozi previously approved these changes Dec 3, 2023
@dosubot dosubot bot added the LGTM label Dec 3, 2023
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Dec 3, 2023
daemon365
daemon365 previously approved these changes Dec 4, 2023
contrib/polaris/config.go Outdated Show resolved Hide resolved
@tan-zhuo tan-zhuo dismissed stale reviews from daemon365 and shenqidebaozi via 3f79526 December 4, 2023 02:57
@tan-zhuo tan-zhuo requested a review from tonybase December 4, 2023 03:01
@shenqidebaozi shenqidebaozi changed the title fix:polaris_config_watch fix:polaris config watch Dec 4, 2023
@shenqidebaozi shenqidebaozi merged commit 6be9610 into go-kratos:main Dec 4, 2023
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LGTM size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants