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

[ISSUE #2123] Feat/polaris ratelimit #2127

Merged
merged 6 commits into from
Nov 21, 2022

Conversation

chuntaojun
Copy link
Contributor

What this PR does:

Which issue(s) this PR fixes:
Fixes #2123

You should pay attention to items below to ensure your pr passes our ci test
We do not merge pr with ci tests failed

  • All ut passed (run 'go test ./...' in project root)
  • After go-fmt ed , run 'go fmt project' using goland.
  • Golangci-lint passed, run 'sudo golangci-lint run' in project root.
  • Your new-created file needs to have apache license at the top, like other existed file does.
  • All integration test passed. You can run integration test locally (with docker env). Clone our dubbo-go-samples project and replace the go.mod to your dubbo-go, and run 'sudo sh start_integration_test.sh' at root of samples project root. (M1 Slice is not Support)

limitApi polaris.LimitAPI
}

func (pl *polarisTpsLimiter) IsAllowable(url *common.URL, invocation protocol.Invocation) bool {
Copy link
Member

Choose a reason for hiding this comment

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

Should it return false if an error occurs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If there is a problem, the current method is not to trigger the current limit, this can be discussed and seen

Copy link
Member

Choose a reason for hiding this comment

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

ok~

@sonarcloud
Copy link

sonarcloud bot commented Nov 19, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.6% 0.6% Duplication

@codecov-commenter
Copy link

Codecov Report

Merging #2127 (f0949de) into master (d70b6c0) will increase coverage by 0.03%.
The diff coverage is 60.60%.

@@            Coverage Diff             @@
##           master    #2127      +/-   ##
==========================================
+ Coverage   44.31%   44.34%   +0.03%     
==========================================
  Files         282      283       +1     
  Lines       16982    17015      +33     
==========================================
+ Hits         7525     7545      +20     
- Misses       8668     8677       +9     
- Partials      789      793       +4     
Impacted Files Coverage Δ
remoting/polaris/builder.go 30.00% <33.33%> (+0.21%) ⬆️
remoting/polaris/parser/parser.go 63.33% <63.33%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@zhaoyunxing92 zhaoyunxing92 merged commit cd2e605 into apache:master Nov 21, 2022
zhaoyunxing92 added a commit that referenced this pull request Nov 21, 2022
AlexStocks pushed a commit that referenced this pull request Nov 26, 2022
* [ISSUE #2123] Feat/polaris ratelimit (#2127)

* feat:support polaris limit ability

* Revert "[ISSUE #2123] Feat/polaris ratelimit (#2127)"

This reverts commit cd2e605.

Co-authored-by: liaochuntao <liaochuntao@live.com>
@justxuewei justxuewei added this to the v3.0.4 milestone Dec 4, 2022
AlexStocks added a commit that referenced this pull request Feb 12, 2023
* [ISSUE #2123] Feat/polaris ratelimit (#2127)

* feat:support polaris limit ability

* [ISSUE #2172] Fix/polaris governance (#2171)

* 解决 consumer 不断重连已下线的 provider meta service 问题 (#2166)

* registry type support all

* fix test

* set default to interface

* use default protocol registry

* fix unit test

* use swith to judge

* add registry support all test

* Resolve registry name conflicts

* fix ut err

* fix #2159

* del front

* del front

Co-authored-by: bobtthp <bobtthp@bob-Mac-mini.local>
Co-authored-by: bob <bob@bobdeMacBook-Pro.local>
Co-authored-by: bobtthp <bobtthp@bob1.local>
Co-authored-by: bob <bob@bob.local>

* build(deps): bump github.com/hashicorp/vault/sdk from 0.6.0 to 0.6.2 (#2169)

Bumps [github.com/hashicorp/vault/sdk](https://github.com/hashicorp/vault) from 0.6.0 to 0.6.2.
- [Release notes](https://github.com/hashicorp/vault/releases)
- [Changelog](https://github.com/hashicorp/vault/blob/main/CHANGELOG.md)
- [Commits](hashicorp/vault@v0.6.0...v0.6.2)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/vault/sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* refactor:polaris ability open judge

* refactor:polaris ability open judge

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: bobtthp <gzqtianc@gmail.com>
Co-authored-by: bobtthp <bobtthp@bob-Mac-mini.local>
Co-authored-by: bob <bob@bobdeMacBook-Pro.local>
Co-authored-by: bobtthp <bobtthp@bob1.local>
Co-authored-by: bob <bob@bob.local>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Dynamic update config for logger level & metric enable (#2180)

* dynamically update logger level & metric enable

* prometheus server start & shutdown

* check nil

* fix ci

Co-authored-by: huangwenkang <642380437@qq>

* Revert "Dynamic update config for logger level & metric enable (#2180)" (#2199)

This reverts commit 4c6a99b.

* Revert "[ISSUE #2172] Fix/polaris governance (#2171)" (#2200)

This reverts commit c1a0698.

* sync: Merge the 3.0 branch into the master branch (#2201)

* 解决 consumer 不断重连已下线的 provider meta service 问题 (#2166)

* registry type support all

* fix test

* set default to interface

* use default protocol registry

* fix unit test

* use swith to judge

* add registry support all test

* Resolve registry name conflicts

* fix ut err

* fix #2159

* del front

* del front

Co-authored-by: bobtthp <bobtthp@bob-Mac-mini.local>
Co-authored-by: bob <bob@bobdeMacBook-Pro.local>
Co-authored-by: bobtthp <bobtthp@bob1.local>
Co-authored-by: bob <bob@bob.local>

* build(deps): bump github.com/hashicorp/vault/sdk from 0.6.0 to 0.6.2 (#2169)

Bumps [github.com/hashicorp/vault/sdk](https://github.com/hashicorp/vault) from 0.6.0 to 0.6.2.
- [Release notes](https://github.com/hashicorp/vault/releases)
- [Changelog](https://github.com/hashicorp/vault/blob/main/CHANGELOG.md)
- [Commits](hashicorp/vault@v0.6.0...v0.6.2)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/vault/sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix: service discovery registry notify before return (#2168)

* Fix: service discovery registry notify before return

* format import

* modify notify url

* add judge about the existence of instance's metadata revision

* build(deps): bump github.com/knadh/koanf from 1.4.4 to 1.4.5 (#2179)

Bumps [github.com/knadh/koanf](https://github.com/knadh/koanf) from 1.4.4 to 1.4.5.
- [Release notes](https://github.com/knadh/koanf/releases)
- [Commits](knadh/koanf@v1.4.4...v1.4.5)

---
updated-dependencies:
- dependency-name: github.com/knadh/koanf
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix: Replace assignment behavior with copy operation to avoid OOM problem (#2182)

* build(deps): bump github.com/hashicorp/vault/sdk from 0.6.2 to 0.7.0 (#2185)

Bumps [github.com/hashicorp/vault/sdk](https://github.com/hashicorp/vault) from 0.6.2 to 0.7.0.
- [Release notes](https://github.com/hashicorp/vault/releases)
- [Changelog](https://github.com/hashicorp/vault/blob/main/CHANGELOG.md)
- [Commits](hashicorp/vault@v0.6.2...v0.7.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/vault/sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump github.com/nacos-group/nacos-sdk-go (#2183)

Bumps [github.com/nacos-group/nacos-sdk-go](https://github.com/nacos-group/nacos-sdk-go) from 1.1.3 to 1.1.4.
- [Release notes](https://github.com/nacos-group/nacos-sdk-go/releases)
- [Commits](nacos-group/nacos-sdk-go@v1.1.3...v1.1.4)

---
updated-dependencies:
- dependency-name: github.com/nacos-group/nacos-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump github.com/knadh/koanf from 1.4.5 to 1.5.0 (#2187)

Bumps [github.com/knadh/koanf](https://github.com/knadh/koanf) from 1.4.5 to 1.5.0.
- [Release notes](https://github.com/knadh/koanf/releases)
- [Commits](knadh/koanf@v1.4.5...v1.5.0)

---
updated-dependencies:
- dependency-name: github.com/knadh/koanf
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump go.etcd.io/etcd/client/v3 from 3.5.6 to 3.5.7 (#2190)

Bumps [go.etcd.io/etcd/client/v3](https://github.com/etcd-io/etcd) from 3.5.6 to 3.5.7.
- [Release notes](https://github.com/etcd-io/etcd/releases)
- [Changelog](https://github.com/etcd-io/etcd/blob/main/Dockerfile-release.amd64)
- [Commits](etcd-io/etcd@v3.5.6...v3.5.7)

---
updated-dependencies:
- dependency-name: go.etcd.io/etcd/client/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump github.com/RoaringBitmap/roaring from 1.2.0 to 1.2.2 (#2188)

Bumps [github.com/RoaringBitmap/roaring](https://github.com/RoaringBitmap/roaring) from 1.2.0 to 1.2.2.
- [Release notes](https://github.com/RoaringBitmap/roaring/releases)
- [Commits](RoaringBitmap/roaring@v1.2.0...v1.2.2)

---
updated-dependencies:
- dependency-name: github.com/RoaringBitmap/roaring
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump github.com/RoaringBitmap/roaring from 1.2.2 to 1.2.3 (#2195)

Bumps [github.com/RoaringBitmap/roaring](https://github.com/RoaringBitmap/roaring) from 1.2.2 to 1.2.3.
- [Release notes](https://github.com/RoaringBitmap/roaring/releases)
- [Commits](RoaringBitmap/roaring@v1.2.2...v1.2.3)

---
updated-dependencies:
- dependency-name: github.com/RoaringBitmap/roaring
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* [ISSUE #2172] Fix/polaris governance (#2171)

* 解决 consumer 不断重连已下线的 provider meta service 问题 (#2166)

* registry type support all

* fix test

* set default to interface

* use default protocol registry

* fix unit test

* use swith to judge

* add registry support all test

* Resolve registry name conflicts

* fix ut err

* fix #2159

* del front

* del front

Co-authored-by: bobtthp <bobtthp@bob-Mac-mini.local>
Co-authored-by: bob <bob@bobdeMacBook-Pro.local>
Co-authored-by: bobtthp <bobtthp@bob1.local>
Co-authored-by: bob <bob@bob.local>

* build(deps): bump github.com/hashicorp/vault/sdk from 0.6.0 to 0.6.2 (#2169)

Bumps [github.com/hashicorp/vault/sdk](https://github.com/hashicorp/vault) from 0.6.0 to 0.6.2.
- [Release notes](https://github.com/hashicorp/vault/releases)
- [Changelog](https://github.com/hashicorp/vault/blob/main/CHANGELOG.md)
- [Commits](hashicorp/vault@v0.6.0...v0.6.2)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/vault/sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* refactor:polaris ability open judge

* refactor:polaris ability open judge

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: bobtthp <gzqtianc@gmail.com>
Co-authored-by: bobtthp <bobtthp@bob-Mac-mini.local>
Co-authored-by: bob <bob@bobdeMacBook-Pro.local>
Co-authored-by: bobtthp <bobtthp@bob1.local>
Co-authored-by: bob <bob@bob.local>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Dynamic update config for logger level & metric enable (#2180)

* dynamically update logger level & metric enable

* prometheus server start & shutdown

* check nil

* fix ci

Co-authored-by: huangwenkang <642380437@qq>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: bobtthp <gzqtianc@gmail.com>
Co-authored-by: bobtthp <bobtthp@bob-Mac-mini.local>
Co-authored-by: bob <bob@bobdeMacBook-Pro.local>
Co-authored-by: bobtthp <bobtthp@bob1.local>
Co-authored-by: bob <bob@bob.local>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Leo Shen <694963063@qq.com>
Co-authored-by: Jason Peng <lvs.pjx@gmail.com>
Co-authored-by: liaochuntao <liaochuntao@live.com>
Co-authored-by: Wenkang Huang <52915386+huangwenkan9@users.noreply.github.com>
Co-authored-by: huangwenkang <642380437@qq>

* ci

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: liaochuntao <liaochuntao@live.com>
Co-authored-by: AlexStocks <alexstocks@foxmail.com>
Co-authored-by: bobtthp <gzqtianc@gmail.com>
Co-authored-by: bobtthp <bobtthp@bob-Mac-mini.local>
Co-authored-by: bob <bob@bobdeMacBook-Pro.local>
Co-authored-by: bobtthp <bobtthp@bob1.local>
Co-authored-by: bob <bob@bob.local>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Wenkang Huang <52915386+huangwenkan9@users.noreply.github.com>
Co-authored-by: huangwenkang <642380437@qq>
Co-authored-by: Xuewei Niu <justxuewei@apache.org>
Co-authored-by: Leo Shen <694963063@qq.com>
Co-authored-by: Jason Peng <lvs.pjx@gmail.com>
Co-authored-by: aqi <aqi@xiaoshijie.com>
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.

[Enhancement] 支持 PolarisMesh 的限流能力
7 participants