[BUG] Sliding-window counts stale entries before cleanup, causing spurious rejection
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
Research direction
Start with shenyu-plugin/shenyu-plugin-fault-tolerance/shenyu-plugin-ratelimiter/src/main/resources/META-INF/scripts/sliding_window_request_rate_limiter.lua, especially lines 34-52, and trace the order of cleanup, counting, and the allow decision. Done means entries outside the window are removed before counting, preventing a spurious 429 at the window boundary.
Written by the indexing model from the issue text.
Description
- severity: Medium
- files:
shenyu-plugin/shenyu-plugin-fault-tolerance/shenyu-plugin-ratelimiter/src/main/resources/META-INF/scripts/sliding_window_request_rate_limiter.lua:34-52 - description: The script computes
last_requested = zcard(tokens_key)(line 37) and the allow decision (line 43) BEFORE callingzremrangebyscore(tokens_key, 0, now - window_size)(line 51). Entries whose score is already outside the window are still counted, then removed afterward. - impact: Intermittent false-negative (429) on the request that crosses the window boundary.
- suggested_fix: Move
zremrangebyscorebefore thezcardcount. - confidence: Medium-High
- related_existing: none
Identified during the 2026-08-02 deep re-scan; full list in docs/scan2-2026-08-02/06-medium-tiers.md.
- Dominant language
- Java
- Stars
- 8.8k
- Forks
- 3.1k
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 85
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/shenyu
-
plugin: mock priority: medium type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
-
admin priority: medium type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
[BUG] DivideIngressParser protocol[i++] throws AIOOBE when protocol array shorter than endpoints Openkubernetes priority: medium type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
[BUG] ContextPathParser concatenates null annotation value with /** — literal null/** rule condition Openkubernetes priority: medium type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
kubernetes priority: medium type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100