Skip to content

feat:support rate-limit window expiration.#672

Open
SkyeBeFreeman wants to merge 2 commits intopolarismesh:mainfrom
SkyeBeFreeman:m/ratelimit-expire
Open

feat:support rate-limit window expiration.#672
SkyeBeFreeman wants to merge 2 commits intopolarismesh:mainfrom
SkyeBeFreeman:m/ratelimit-expire

Conversation

@SkyeBeFreeman
Copy link
Copy Markdown
Member

@SkyeBeFreeman SkyeBeFreeman commented Dec 8, 2025

fixes #657

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 8, 2025

Codecov Report

❌ Patch coverage is 9.09091% with 150 lines in your changes missing coverage. Please review.
✅ Project coverage is 22.24%. Comparing base (b3df955) to head (95d47b1).

Files with missing lines Patch % Lines
.../polaris/ratelimit/client/flow/StreamResource.java 25.86% 40 Missing and 3 partials ⚠️
...aris/ratelimit/client/flow/RateLimitExtension.java 0.00% 25 Missing ⚠️
...polaris/ratelimit/client/flow/WindowContainer.java 0.00% 21 Missing ⚠️
...polaris/ratelimit/client/flow/RateLimitWindow.java 0.00% 18 Missing ⚠️
...aris/ratelimit/client/flow/RateLimitWindowSet.java 0.00% 11 Missing ⚠️
...ncent/polaris/ratelimit/client/flow/QuotaFlow.java 0.00% 8 Missing ⚠️
...om/tencent/polaris/api/plugin/route/RouteInfo.java 0.00% 6 Missing ⚠️
...olaris/ratelimit/client/flow/StreamCounterSet.java 0.00% 6 Missing ⚠️
...ratelimit/client/flow/AsyncRateLimitConnector.java 0.00% 5 Missing ⚠️
...s/ratelimit/client/sync/PolarisRemoteSyncTask.java 0.00% 5 Missing ⚠️
... and 1 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #672      +/-   ##
============================================
+ Coverage     22.04%   22.24%   +0.20%     
- Complexity     1204     1222      +18     
============================================
  Files           413      413              
  Lines         17191    17334     +143     
  Branches       2222     2245      +23     
============================================
+ Hits           3789     3856      +67     
- Misses        12973    13033      +60     
- Partials        429      445      +16     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Haotian Zhang <928016560@qq.com>
…rt conflict

- Add StreamResourceTest to reproduce the bug where counters.putIfAbsent
  fails to replace old DurationBaseCallback after rule revision update,
  causing server quota responses to be routed to stale windows
- Fix WindowExpireAndRecoverTest port conflict in CI by using dynamic
  port allocation (-1) instead of hardcoded port 10097
- Add debug-level diagnostic logs for rate limit quota synchronization,
  local usage reporting, mode degradation and period boundary reset

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Haotian Zhang <928016560@qq.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.

优化本地限流窗口过期机制

1 participant