Skip to content

feat(natsstore): queue refresh requests in a work-queue stream - #24

Open
yordis wants to merge 1 commit into
yordis/feat-natsstore-journale2efrom
yordis/feat-natsstore-refreshstream
Open

yordis wants to merge 1 commit into
yordis/feat-natsstore-journale2efrom
yordis/feat-natsstore-refreshstream

Conversation

@yordis

@yordis yordis commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Refresh requests need one place to wait so that exactly one replica handles each. A work-queue stream with dedupe gives that without a coordinator, and a request that nobody handles expires instead of piling up.

Replicas that each refresh an expiring credential race each other and
waste provider calls. A work-queue stream with one request per credential
and one shared consumer lets exactly one replica win each request, and
duplicate requests are refused instead of queued twice. The consumer keeps
a running handler alive with progress signals so a slow provider call is
not redelivered to a second replica mid-refresh.

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: e74f135c-21c4-452f-989a-7de04355114b
Commits

Reviewing files that changed from the base of the PR and between 150d940 and d9504d0.

Files selected for processing: 3

  • internal/store/natsstore/bootstrap.go
  • internal/store/natsstore/refresh_queue.go
  • internal/store/natsstore/refresh_queue_test.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