Skip to content

feat(natsstore): lease Antigravity refreshes so one replica refreshes - #27

Open
yordis wants to merge 1 commit into
yordis/feat-natsstore-refreshworkerfrom
yordis/feat-natsstore-antigravitylease
Open

yordis wants to merge 1 commit into
yordis/feat-natsstore-refreshworkerfrom
yordis/feat-natsstore-antigravitylease

Conversation

@yordis

@yordis yordis commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Antigravity grants are reusable, so the no-expiry journal claim is too strict: a crashed replica would block refresh forever. A short lease in its own bucket lets one replica refresh and lets another take over after it expires. The journal bucket cannot hold key TTLs, hence the separate bucket.

Antigravity grants stay valid after use, so the journal claim is wrong
for them, yet every replica refreshing the same expiring token wastes
provider calls. A short lease in its own bucket lets one replica refresh
while the others adopt the result. Per-key TTL is fixed at creation and
an update drops it, so a lease is never renewed: it runs out on the
server and the next create wins. The journal bucket stays free of TTL
because its claims must never expire.

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: 99e04f8b-d3a7-4ae7-8af4-16f1d81a71df
Commits

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

Files selected for processing: 9

  • internal/runtime/executor/refresh_policy.go
  • internal/store/natsstore/kv.go
  • internal/store/natsstore/refresh_lease.go
  • internal/store/natsstore/refresh_lease_test.go
  • internal/store/natsstore/store.go
  • sdk/cliproxy/auth/conductor_refresh.go
  • sdk/cliproxy/auth/refresh_lease.go
  • sdk/cliproxy/auth/refresh_lease_test.go
  • sdk/cliproxy/auth/refresh_policy.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