Deduplicate refreshes by storage row - #6361
Merged
Merged
Conversation
jhrozek
requested review from
ChrisJBurns,
JAORMX,
amirejaz,
rdimitrov and
tgrunnagle
as code owners
August 18, 2026 09:06
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6361 +/- ##
==========================================
+ Coverage 72.99% 73.04% +0.04%
==========================================
Files 744 744
Lines 78611 78648 +37
==========================================
+ Hits 57385 57449 +64
+ Misses 17226 17178 -48
- Partials 4000 4021 +21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jhrozek
force-pushed
the
6356-singleflight-storage
branch
from
August 19, 2026 08:05
5993515 to
67cffe7
Compare
JAORMX
approved these changes
Aug 19, 2026
Fixes stacklok#6356. Use an opaque storage-defined row identity as the in-process singleflight key instead of the caller session ID. Re-read the authoritative row inside the flight so late callers do not redeem a stale rotated refresh token, and return independent token copies to each caller. Memory and Redis derive opaque hashed row identities. Tests cover aliased rows, late stale callers, independent rows, resolver failures, and result isolation. This remains process-local; distributed coordination is tracked by stacklok#4122.
jhrozek
force-pushed
the
6356-singleflight-storage
branch
from
August 19, 2026 08:14
67cffe7 to
7643795
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #6356
Type of change
Test plan
task test) — run; blocked by the unrelated Docker predefined-address-pool exhaustion inpkg/container/docker/TestCreateNetwork_ConcurrentSameName.task test-e2e)task lint-fix)Changes
pkg/authserver/storage/types.gopkg/authserver/storage/{memory,redis}.gopkg/authserver/refresher.gopkg/authserver/refresher_test.gopkg/authserver/storage/types_test.godocs/arch/11-auth-server-storage.mdDoes this introduce a user-facing change?
No
Implementation plan
Approved implementation plan
UpstreamTokenRowIDand resolver toUpstreamTokenStorage; storage defines which logical lookups share a row.singleflight, then re-read the authoritative row inside the bounded flight; return a fresh row directly or refresh the re-read expired snapshot.Special notes for reviewers
task testreached the changed auth/storage packages successfully but failed in the Docker network test because the local Docker daemon had exhausted its predefined address pools.