Skip to content

fix(http): replace rate limiter semaphore with per-endpoint token bucket - #91

Merged
austin-barrington merged 3 commits into
mainfrom
fix/rate-limiter-token-bucket
Jul 9, 2026
Merged

fix(http): replace rate limiter semaphore with per-endpoint token bucket#91
austin-barrington merged 3 commits into
mainfrom
fix/rate-limiter-token-bucket

Conversation

@austin-barrington

@austin-barrington austin-barrington commented Jul 9, 2026

Copy link
Copy Markdown
Member

Description

The old Semaphore never refilled, permanently blocking requests after the initial budget was consumed. Use token buckets that refill every second, with independent budgets for /write and /query. Rate limiting now runs before auth and records hyperbytedb_rate_limit_denied_total.

Related issues

Closes #62, #80

Checklist

  • cargo fmt --all --check passes
  • cargo clippy --all-targets -- -D warnings passes
  • cargo test --lib passes
  • cargo test --test '*' passes
  • New features have documentation (user-guide or developer-guide)
  • New config keys have entries in docs/user-guide/configuration.md and config.toml.example
  • New metrics follow the naming convention (hyperbytedb_*)
  • Breaking changes are noted in the PR description

Release notes

Test plan

The old Semaphore never refilled, permanently blocking requests after the
initial budget was consumed. Use token buckets that refill every second,
with independent budgets for /write and /query. Rate limiting now runs
before auth and records hyperbytedb_rate_limit_denied_total.

Closes #62, #80
@austin-barrington
austin-barrington merged commit ff207f3 into main Jul 9, 2026
7 of 8 checks passed
@austin-barrington
austin-barrington deleted the fix/rate-limiter-token-bucket branch July 9, 2026 18:56
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.

V1 [BUG] Rate limiter semaphore never replenishes — permanently blocks writes/queries after limit reached

1 participant