maintain cluster active connection counter for circuit breaker
What type of PR is this? feature
What this PR does / why we need it:
Which issue(s) this PR fixes: Fixes #
Proposal here https://github.com/kmesh-net/kmesh/pull/397
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
how should i get the cluster id? Using cluster name will exceed the stack size limit? may be extract hashName to a public package?
It's quite confusing
Some files need to be updated, please run 'make gen' and include any changed files in your PR
Codecov Report
Attention: Patch coverage is 64.06250% with 23 lines in your changes missing coverage. Please review.
Project coverage is 49.54%. Comparing base (
1902392) to head (e9af645). Report is 48 commits behind head on main.
| Files with missing lines | Coverage Δ | |
|---|---|---|
| pkg/bpf/ads/loader.go | 47.43% <100.00%> (+1.38%) |
:arrow_up: |
| pkg/bpf/workload/sock_connection.go | 54.01% <ø> (ø) |
|
| pkg/bpf/workload/sock_ops.go | 55.88% <ø> (ø) |
|
| pkg/bpf/workload/xdp.go | 48.57% <ø> (ø) |
|
| pkg/controller/ads/ads_controller.go | 80.70% <100.00%> (ø) |
|
| pkg/controller/ads/ads_processor.go | 75.33% <100.00%> (ø) |
|
| pkg/controller/client.go | 65.62% <100.00%> (ø) |
|
| pkg/controller/workload/workload_processor.go | 61.67% <50.00%> (+2.51%) |
:arrow_up: |
| pkg/controller/ads/cache.go | 48.67% <66.66%> (+0.16%) |
:arrow_up: |
| pkg/controller/controller.go | 0.00% <0.00%> (ø) |
|
| ... and 3 more |
... and 10 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update a4ca182...e9af645. Read the comment docs.
/unhold
I use a special way to reject connection, plz check MARK_REJECTED macro.
Tested in oe23.03.
met some errors when using bpf_spin_lock:
has to have BTF in order to use bpf_spin_lock (98 line(s) omitted)
https://github.com/cilium/cilium/issues/29216
In kmesh we donot create bpf map within cilium lib. It is from c code.
Not sure https://blog.csdn.net/superbfly/article/details/128204317 can help
In kmesh we donot create bpf map within cilium lib. It is from c code.
Not sure https://blog.csdn.net/superbfly/article/details/128204317 can help
tried it before, not work. I am using atomic apis now.
One last comment: we should delete map_of_cluster_stats when a cluster is removed, but i donot see this
ok, i will delete them in user space.
envoy also supports config for per-host max connection thresholds(host is namely endpoint). Do we need this?
Yes, but istio doesnot support it. And so we cannot get per host circuit breaker settings
this pr needs another review :)
Please solve the conflicts
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: hzxuzhonghu
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [hzxuzhonghu]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment