Visitar URL original
Named rate-limit configurations reset the limiter on every request · Issue #2816 · networknt/light-4j · GitHub
Skip to content

Named rate-limit configurations reset the limiter on every request #2816

Closed

Description

@stevehu

When LimitHandler uses a custom configuration name, LimitConfig.load(customName) creates a new object on every call. The handler treats an object identity change as a configuration reload and replaces its rate limiter. Repeated requests can therefore reset the quota even when the underlying configuration has not changed.

The default limit name has a cache keyed by the identity of its configuration map; custom names bypass that cache.

Source paths:

  • limit-config/src/main/java/com/networknt/limit/LimitConfig.java, load(String)
  • rate-limit/src/main/java/com/networknt/limit/LimitHandler.java, configuration identity/reload handling

Acceptance:

  • Reproduce using a named configuration and repeated requests within one quota window.
  • Keep the same limiter when the named configuration is unchanged.
  • Apply changed named configurations through the supported reload path.
  • Cover independent named configurations, default-name behavior, and reload isolation.

Discovered during the Jackson 3 migration review of #2815. This production bug is not repaired by that PR's fixture changes and needs a separately scoped fix. The current evidence is source inspection; do not infer a deployed-service reproduction.

Activity

  1. stevehu commented on Oct 29, 2026

    @stevehu
    ContributorAuthor

    Named config file is only used for test cases and production is using the default name. Not an issue.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions