Skip to content

[BUG] RedisRateLimiter silently swallows Redis errors and fail-opens (dead doOnError) #6645

Closed

Description

@Aias00
  • severity: High
  • files: shenyu-plugin/shenyu-plugin-fault-tolerance/shenyu-plugin-ratelimiter/src/main/java/org/apache/shenyu/plugin/ratelimiter/executor/RedisRateLimiter.java:63-75
  • description: resultFlux.onErrorResume(throwable -> Flux.just(Arrays.asList(1L, -1L))) converts any Redis error into a normal emission of {allowed=1, tokensLeft=-1}. The downstream .reduce().map() completes successfully, so the trailing .doOnError(...) (which logs and calls the callback) is unreachable — onErrorResume already absorbed the error. Net effect: on Redis outage every request is allowed (fail-open) AND nothing is logged.
  • impact: Complete, invisible bypass of rate limiting during Redis outages; operators get no log signal.
  • suggested_fix: Move logging into the onErrorResume lambda; make fail-open vs fail-closed an explicit, logged policy.
  • confidence: High
  • related_existing: none — Cluster current limiting #5376/RateLimiter remoteAddress issues Please reply #5340/[Question] leaky rate limiter lua set new_bucket_count ? #5021 are different.

Identified during the 2026-08-02 deep re-scan; full list in docs/scan2-2026-08-02/00-consolidated-critical-high.md.

Activity

  1. added
    type: bug
    priority: high
    on Aug 3, 2026
  2. github-actions commented on Aug 3, 2026

    @github-actions
    Contributor

    👋 Hello @yuluo-yx

    A new issue has been opened by @Aias00:

    Please review when you have time. Thank you! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin: ratelimiterpriority: hightype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions