Skip to content

Fix rate limiter Redis subsecond timestamp handling #60

@lucarlig

Description

@lucarlig

Summary

The rate limiter Redis backend currently derives sliding-window and token-bucket Lua timestamps from an integer Unix second. Multiple requests inside the same second can share the same Redis script timestamp/member prefix and token-bucket refill calculations lose subsecond precision.

Expected fix

Capture the current SystemTime duration once, pass both integer seconds and fractional seconds into the Redis evaluation path, and add deterministic tests for sliding-window member timestamps and token-bucket refill args.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions