Skip to content

feat(natsstore): keep cooldown state in a bucket with per-key TTL - #28

Open
yordis wants to merge 1 commit into
yordis/feat-natsstore-antigravityleasefrom
yordis/feat-natsstore-cooldownstore
Open

yordis wants to merge 1 commit into
yordis/feat-natsstore-antigravityleasefrom
yordis/feat-natsstore-cooldownstore

Conversation

@yordis

@yordis yordis commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Cooldown state was local to each replica, so one replica could keep sending traffic to a credential another had already seen rate limited. KV with per-key TTL shares it and lets it expire on its own.

Replicas that share credentials must share what is cooling down, or one
replica keeps sending to a credential another already learned is limited.
Records expire on the server once their retry time has passed, and a
write never replaces a record with a newer update time, matching the
PostgreSQL store. A cleared record leaves a short-lived tombstone so a
replica that missed the clearing cannot bring it back.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f530ba7e-683e-4b51-9409-06012a1bf3ed
Commits

Reviewing files that changed from the base of the PR and between cdfa3b9 and f939cad.

Files selected for processing: 3

  • internal/store/natsstore/cooldown_store.go
  • internal/store/natsstore/cooldown_store_test.go
  • internal/store/natsstore/store.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@yordis
yordis added this pull request to stack #9 November 8, 2026 03:32

This branch has not been deployed

No deployments
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.

1 participant