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

修复健康检查被限流住 #291

Merged
merged 2 commits into from
Jul 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions examples/dev/conf/chassis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ servicecomb:
protocols:
rest:
listenAddress: 127.0.0.1:30110
match:
rateLimitPolicy: |
matches:
- apiPath:
contains: "/kie"
rateLimiting:
global: |
match: none
limiterPolicy1: |
match: rateLimitPolicy
rate: 200
burst: 200
handler:
Expand Down
9 changes: 7 additions & 2 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ servicecomb:
protocols:
rest:
listenAddress: ${listen_addr}:30110
match:
rateLimitPolicy: |
matches:
- apiPath:
contains: "/kie"
rateLimiting:
global: |
match: none
limiterPolicy1: |
match: rateLimitPolicy
rate: 200
burst: 200
handler:
Expand Down
10 changes: 5 additions & 5 deletions server/service/kv/kv_svc.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func Create(ctx context.Context, kv *model.KVDoc) (*model.KVDoc, *errsvc.Error)
fmt.Sprintf("can not updateKeyValue version for [%s] [%s] in [%s]",
kv.Key, kv.Labels, kv.Domain))
}
openlog.Debug(fmt.Sprintf("create %s with labels %s value [%s]", kv.Key, kv.Labels, kv.Value))
openlog.Debug(fmt.Sprintf("create %s with labels %s length [%d]", kv.Key, kv.Labels, len(kv.Value)))
datasource.ClearPart(kv)
return kv, nil
}
Expand Down Expand Up @@ -246,17 +246,17 @@ func Update(ctx context.Context, kv *model.UpdateKVRequest) (*model.KVDoc, error
return nil, err
}
openlog.Info(
fmt.Sprintf("update %s with labels %s value [%s]",
oldKV.Key, oldKV.Labels, kv.Value))
fmt.Sprintf("update %s with labels %s length [%d]",
oldKV.Key, oldKV.Labels, len(kv.Value)))
err = datasource.GetBroker().GetHistoryDao().AddHistory(ctx, oldKV)
if err != nil {
openlog.Error(
fmt.Sprintf("can not add revision for [%s] [%s] in [%s],err: %s",
oldKV.Key, oldKV.Labels, kv.Domain, err))
}
openlog.Debug(
fmt.Sprintf("add history %s with labels %s value [%s]",
oldKV.Key, oldKV.Labels, oldKV.Value))
fmt.Sprintf("add history %s with labels %s length [%d]",
oldKV.Key, oldKV.Labels, len(oldKV.Value)))
datasource.ClearPart(oldKV)
return oldKV, nil

Expand Down
Loading