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

优化longPulling err时delay、防止日志瞬间写满 #92

Merged
merged 1 commit into from
Jul 31, 2020

Conversation

tengzbiao
Copy link

No description provided.

@codecov-commenter
Copy link

Codecov Report

Merging #92 into develop will increase coverage by 0.18%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #92      +/-   ##
===========================================
+ Coverage    72.00%   72.19%   +0.18%     
===========================================
  Files           15       15              
  Lines         1186     1194       +8     
===========================================
+ Hits           854      862       +8     
  Misses         265      265              
  Partials        67       67              
Impacted Files Coverage Δ
clients/config_client/config_client.go 62.54% <100.00%> (+1.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7a3fc3e...3ae5e66. Read the comment docs.

changedConfigs := strings.Split(changed, "%01")
for _, config := range changedConfigs {
attrs := strings.Split(config, "%02")
if len(attrs) >= 2 {
if value, ok := cacheMap.Get(utils.GetConfigCacheKey(attrs[0], attrs[1], tenant)); ok {
cData := value.(cacheData)
if content, err := client.getConfigInner(vo.ConfigParam{
if content, err2 := client.getConfigInner(vo.ConfigParam{
Copy link
Collaborator

Choose a reason for hiding this comment

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

为什么要使用err2这个变量?我觉得不需要引入这个变量

Copy link
Author

Choose a reason for hiding this comment

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

client.getConfigInner如果出错(比如group或dataid错误),日志还是会大量报错(config_client.go 429行)

const perTaskConfigSize = 3000
const (
perTaskConfigSize = 3000
executorErrDelay = 20 * time.Second
Copy link
Collaborator

Choose a reason for hiding this comment

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

20秒太长停顿时间了,5秒合适点

Copy link
Author

Choose a reason for hiding this comment

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

可以的

@lzp0412 lzp0412 merged commit fd4c747 into nacos-group:develop Jul 31, 2020
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