Skip to content

fix(ratelimiter): evict stale requests before count - #7120

Merged
Aias00 merged 9 commits into
apache:masterfrom
dengliming:fix-6754-sliding-window-cleanup-order
Sep 22, 2026
Merged

Aias00 merged 9 commits into
apache:masterfrom
dengliming:fix-6754-sliding-window-cleanup-order

Conversation

@dengliming

Copy link
Copy Markdown
Member

Summary

  • remove expired sliding-window entries before counting current requests
  • prevent a stale entry from causing a false rate-limit rejection
  • add an embedded Redis regression test for a full but expired window

Testing

  • mvn -q -pl shenyu-plugin/shenyu-plugin-fault-tolerance/shenyu-plugin-ratelimiter -am -DskipTests=false -Dcheckstyle.skip=false -Dtest=RedisRateLimiterScriptsTest -DfailIfNoTests=false test

Fixes #6754

@Aias00 Aias00 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved as PMC (Aias00). Reviewed the diff — small, well-scoped fix with regression tests; mergeable.

@Aias00
Aias00 merged commit 78bf41a into apache:master Sep 22, 2026
22 checks passed
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.

[BUG] Sliding-window counts stale entries before cleanup, causing spurious rejection

2 participants